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(),
)
}Content copied to clipboard
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(),
)
}Content copied to clipboard