Package-level declarations

Types

Link copied to clipboard

Defines how to scroll the scrollable component and how to display a scrollbar for it.

Link copied to clipboard
data class ScrollbarStyle(val minimalHeight: Dp, val thickness: Dp, val shape: Shape, val hoverDurationMillis: Int, val unhoverColor: Color, val hoverColor: Color)

Defines visual style of scrollbars (thickness, shapes, colors, etc). Can be passed as a parameter of scrollbar through LocalScrollbarStyle

Properties

Link copied to clipboard

CompositionLocal used to pass ScrollbarStyle down the tree. This value is typically set in some "Theme" composable function (DesktopTheme, MaterialTheme)

Link copied to clipboard

The maximum scroll offset of the scrollable content.

Functions

Link copied to clipboard

Simple default ScrollbarStyle without applying MaterialTheme.

Link copied to clipboard
fun HorizontalScrollbar(adapter: ScrollbarAdapter, modifier: Modifier = Modifier, reverseLayout: Boolean = false, style: ScrollbarStyle = LocalScrollbarStyle.current, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() })

Horizontal scrollbar that can be attached to some scrollable component (Modifier.verticalScroll(), LazyRow) and share common state with it.

Link copied to clipboard
@JvmName(name = "rememberScrollbarAdapter2")
fun rememberScrollbarAdapter(scrollState: ScrollState): ScrollbarAdapter

Create and remember for scrollable container with the given instance ScrollState.

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

Create and remember for lazy scrollable container with the given instance LazyListState.

Link copied to clipboard
@JvmName(name = "ScrollbarAdapter2")
fun ScrollbarAdapter(scrollState: ScrollState): ScrollbarAdapter

ScrollbarAdapter for Modifier.verticalScroll and Modifier.horizontalScroll

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

ScrollbarAdapter for lazy lists.

Link copied to clipboard
fun VerticalScrollbar(adapter: ScrollbarAdapter, modifier: Modifier = Modifier, reverseLayout: Boolean = false, style: ScrollbarStyle = LocalScrollbarStyle.current, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() })

Vertical scrollbar that can be attached to some scrollable component (ScrollableColumn, LazyColumn) and share common state with it.