ScrollbarAdapter

@JvmName(name = "ScrollbarAdapter2")
fun ScrollbarAdapter(scrollState: ScrollState): ScrollbarAdapter

ScrollbarAdapter for Modifier.verticalScroll and Modifier.horizontalScroll

scrollState is instance of ScrollState which is used by scrollable component

Example: val state = rememberScrollState(0)

Box(Modifier.fillMaxSize()) {
    Box(modifier = Modifier.verticalScroll(state)) {
        ...
    }

    VerticalScrollbar(
        adapter = rememberScrollbarAdapter(state)
        modifier = Modifier.align(Alignment.CenterEnd).fillMaxHeight(),
    )
}

@JvmName(name = "ScrollbarAdapter2")
fun ScrollbarAdapter(scrollState: LazyListState): ScrollbarAdapter

ScrollbarAdapter for lazy lists.

scrollState is instance of LazyListState which is used by scrollable component

Example: Box(Modifier.fillMaxSize()) { val state = rememberLazyListState()

    LazyColumn(state = state) {
        ...
    }

    VerticalScrollbar(
        adapter = rememberScrollbarAdapter(state)
        modifier = Modifier.align(Alignment.CenterEnd).fillMaxHeight(),
    )
}