horizontalScrollWithScrollbar

fun Modifier.horizontalScrollWithScrollbar(scrollState: ScrollState, scrollbarState: ScrollbarState, enabled: Boolean = true, flingBehavior: FlingBehavior? = null, reverseScrolling: Boolean = false, scrollbarConfig: ScrollbarConfig = ScrollbarConfig(), onDrawScrollbar: DrawScope.(measurements: ScrollbarMeasurements) -> Unit = { measurements -> drawDefaultScrollbar(measurements, scrollbarConfig) }): Modifier

Modify element to allow to scroll horizontally when width of the content is bigger than max constraints allow. Also displays draggable scrollbar

Parameters

scrollState

state of the scroll

scrollbarState

state of the scrollbar

enabled

whether or not scrolling via touch input is enabled

flingBehavior

logic describing fling behavior when drag has finished with velocity. If null, default from ScrollableDefaults.flingBehavior will be used.

reverseScrolling

reverse the direction of scrolling, when true, 0 ScrollState.value will mean right, when false, 0 ScrollState.value will mean left

scrollbarConfig

The configuration for the scrollbar's appearance and behavior.

onDrawScrollbar

Optional param to define the custom drawing for Scrollbar.

See also

Samples

com.shambu.compose.scrollbar.sample.HorizontalScrollWithScrollbarSample
fun Modifier.horizontalScrollWithScrollbar(scrollState: ScrollState, scrollbarState: ScrollbarState, enabled: Boolean = true, flingBehavior: FlingBehavior? = null, reverseScrolling: Boolean = false, alwaysShowScrollbar: Boolean = false, autoHideScrollbarAnimationSpec: AnimationSpec<Float>? = null, enableScrollbarDrag: Boolean = true, onMeasureAndDrawScrollbar: ScrollbarMeasureAndDraw): Modifier

Modify element to allow to scroll horizontally when width of the content is bigger than max constraints allow. Also displays draggable scrollbar

Parameters

scrollState

state of the scroll

scrollbarState

state of the scrollbar

enabled

whether or not scrolling via touch input is enabled

flingBehavior

logic describing fling behavior when drag has finished with velocity. If null, default from ScrollableDefaults.flingBehavior will be used.

reverseScrolling

reverse the direction of scrolling, when true, 0 ScrollState.value will mean right, when false, 0 ScrollState.value will mean left

alwaysShowScrollbar

If true, the scrollbar is always visible. Default is false (auto-hide).

autoHideScrollbarAnimationSpec

Animation for auto-hiding the scrollbar. Default auto-hide animation if not specified.

enableScrollbarDrag

If true, the scrollbar is draggable. Default is true.

onMeasureAndDrawScrollbar

To measure and draw the scrollbar.

See also

Samples

com.shambu.compose.scrollbar.sample.HorizontalScrollWithScrollbarSample