Composable Component

VerticalList

This is a scrolling list component that only composes and lays out the currently visible items.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

VerticalList

Android
@Composable
public fun VerticalList(
    modifier: Modifier = Modifier,
    state: ListState = rememberListState(),
    contentPadding: PaddingValues = VerticalListDefaults.contentPadding,
    userScrollEnabled: Boolean = true,
    overscrollEffect: OverscrollEffect? = rememberOverscrollEffect(),
    flingBehavior: FlingBehavior = VerticalListDefaults.flingBehavior(state),
    reverseLayout: Boolean = false,
    horizontalAlignment: Alignment.Horizontal = Alignment.Start,
    verticalArrangement: Arrangement.Vertical = VerticalListDefaults.verticalArrangement,
    content: ListScope.() -> Unit,
): Unit

Parameters

modifier the modifier to apply to this layout.
state the state object to be used to control or observe the list's state.
contentPadding a padding around the whole content. This will add padding for the content after it has been clipped, which is not possible via modifier param. You can use it to add a padding before the first item or after the last one.
userScrollEnabled If user gestures are enabled.
overscrollEffect the OverscrollEffect that will be used to render overscroll for this layout. Note that the OverscrollEffect.node will be applied internally as well - you do not need to use Modifier.overscroll separately.
flingBehavior logic describing fling and snapping behavior when drag has finished.
reverseLayout reverses the direction of scrolling and layout.
horizontalAlignment aligns items horizontally.
verticalArrangement is arrangement for items. This only applies if the content is smaller than the viewport.
content a block which describes the content. Inside this block you can use methods like ListScope.item to add a single item or ListScope.items to add a list of items.

VerticalList

Android
@Composable
public fun VerticalList(
    title: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    state: ListState = rememberListState(),
    contentPadding: PaddingValues = VerticalListDefaults.contentPaddingWithTitle,
    userScrollEnabled: Boolean = true,
    overscrollEffect: OverscrollEffect? = rememberOverscrollEffect(),
    flingBehavior: FlingBehavior = VerticalListDefaults.flingBehavior(state),
    reverseLayout: Boolean = false,
    horizontalAlignment: Alignment.Horizontal = Alignment.Start,
    verticalArrangement: Arrangement.Vertical = VerticalListDefaults.verticalArrangement,
    content: ListScope.() -> Unit,
)

Parameters

title a composable slot for the list title, expected to be a androidx.xr.glimmer.TitleChip. It overlaps the list, positioned at the top-center, and remains stuck to the top when the list is scrolled.
modifier applies to the layout that contains both list and title.
state the state object to be used to control or observe the list's state.
contentPadding a padding around the whole content. This will add padding for the content after it has been clipped, which is not possible via modifier param. You can use it to add a padding before the first item or after the last one. The list is vertically offset to start from the title's vertical center, so custom content paddings must provide sufficient space to avoid content being obscured.
userScrollEnabled If user gestures are enabled.
overscrollEffect the OverscrollEffect that will be used to render overscroll for this layout. Note that the OverscrollEffect.node will be applied internally as well - you do not need to use Modifier.overscroll separately.
flingBehavior logic describing fling and snapping behavior when drag has finished.
reverseLayout reverses the direction of scrolling and layout.
horizontalAlignment aligns items horizontally.
verticalArrangement is arrangement for items. This only applies if the content is smaller than the viewport.
content a block which describes the content. Inside this block you can use methods like ListScope.item to add a single item or ListScope.items to add a list of items.