VerticalPager

fun UiTreeBuilder.VerticalPager(currentPage: Int, onPageChanged: (Int) -> Unit, pagerState: PagerState? = null, offscreenPageLimit: Int = -1, userScrollEnabled: Boolean = true, reusePolicy: CollectionReusePolicy = CollectionReusePolicy(), motionPolicy: CollectionMotionPolicy = CollectionMotionPolicy(), focusFollowKeyboard: Boolean = false, key: Any? = null, modifier: Modifier = Modifier, pages: HorizontalPagerScope.() -> Unit)(source)

Emits a vertical pager with one keyed lazy session per page.

Settled callback and pagerState semantics match HorizontalPager. Keyboard focus-follow may request the focused descendant page into view without transferring page-session identity.

Receiver

active tree builder receiving the pager node

Parameters

currentPage

controlled page selected for this render

onPageChanged

callback receiving a newly settled page index

pagerState

optional caller-owned observation and command state

offscreenPageLimit

native adjacent-page residency limit, or -1 for the platform default

userScrollEnabled

whether direct user paging is accepted

reusePolicy

native page-presentation reuse hints

motionPolicy

native page-mutation animation hints

focusFollowKeyboard

whether keyboard focus may bring a descendant page into view

key

optional stable sibling identity used during reconciliation

modifier

ordered configuration applied to the pager root

pages

explicitly keyed delayed page declarations

Throws

for duplicate page keys or an invalid offscreen limit

Samples

val tree = buildVNodeTree {
    HorizontalPager(currentPage = 0, onPageChanged = {}) {
        Page("account", 4, contentType = "account-page") {
            Text("Account")
        }
    }
    TabRow(selectedIndex = 0, onTabSelected = {}) {
        Tab("overview", 2) { selected ->
            Text(if (selected) "Overview selected" else "Overview")
        }
    }
}
val page = (tree.first().spec as HorizontalPagerNodeProps).pages.single()

check(page.key == "account")
check(page.contentRevision == 4)
check(tree.last().children.single().key == "overview")