ScrollbarConfig

data class ScrollbarConfig(val indicatorThickness: Dp = 8.dp, val indicatorCornerRadius: Dp = indicatorThickness / 2, val indicatorColor: ColorType = ColorType.Solid(Color.DarkGray.copy(alpha = 0.75f)), val indicatorBorder: BorderStyle = BorderStyle(ColorType.Solid(Color.Transparent), 0.dp), val minimumIndicatorLength: Dp = 24.dp, val maximumIndicatorLength: Dp = Dp.Infinity, val barThickness: Dp = indicatorThickness, val barCornerRadius: Dp = barThickness / 2, val barColor: ColorType = ColorType.Solid(Color.LightGray.copy(alpha = 0.75f)), val barBorder: BorderStyle = BorderStyle(ColorType.Solid(Color.Transparent), 0.dp), val showAlways: Boolean = false, val autoHideAnimationSpec: AnimationSpec<Float>? = null, val padding: PaddingValues = PaddingValues(all = 0.dp), val indicatorPadding: PaddingValues = PaddingValues(all = 0.dp), val isDragEnabled: Boolean = true)

Configuration for customizing the appearance and behavior of a scrollbar.

See also

Constructors

Link copied to clipboard
constructor(indicatorThickness: Dp = 8.dp, indicatorCornerRadius: Dp = indicatorThickness / 2, indicatorColor: ColorType = ColorType.Solid(Color.DarkGray.copy(alpha = 0.75f)), indicatorBorder: BorderStyle = BorderStyle(ColorType.Solid(Color.Transparent), 0.dp), minimumIndicatorLength: Dp = 24.dp, maximumIndicatorLength: Dp = Dp.Infinity, barThickness: Dp = indicatorThickness, barCornerRadius: Dp = barThickness / 2, barColor: ColorType = ColorType.Solid(Color.LightGray.copy(alpha = 0.75f)), barBorder: BorderStyle = BorderStyle(ColorType.Solid(Color.Transparent), 0.dp), showAlways: Boolean = false, autoHideAnimationSpec: AnimationSpec<Float>? = null, padding: PaddingValues = PaddingValues(all = 0.dp), indicatorPadding: PaddingValues = PaddingValues(all = 0.dp), isDragEnabled: Boolean = true)

Properties

Link copied to clipboard

The animation specification for auto-hiding the scrollbar. If null, a default auto-hide animation is used. Defines timing and easing for fading out the scrollbar.

Link copied to clipboard

The border styling for the scrollbar track, such as color and thickness. See BorderStyle for details. Default is no border.

Link copied to clipboard

The color of the scrollbar track. Can be a solid color or a gradient, specified by ColorType. Default is a semi-transparent light gray.

Link copied to clipboard

Specifies the corner radius of the scrollbar track, allowing rounded edges if desired. Default is half of barThickness, making it fully rounded if barThickness is greater than 0.

Link copied to clipboard

Defines the thickness of the scrollbar track, which is the stationary part along which the indicator moves. By default, this matches indicatorThickness for a consistent appearance.

Link copied to clipboard

The border styling for the scrollbar indicator, such as color and thickness. See BorderStyle for details. Default is no border.

Link copied to clipboard

The color of the scrollbar indicator. Can be a solid color or a gradient defined by ColorType. By default, this is set to a semi-transparent dark gray.

Link copied to clipboard

Defines the corner radius of the scrollbar indicator, giving it a rounded appearance if desired. By default, this is set to half the indicatorThickness, making it fully rounded if indicatorThickness is greater than 0.

Link copied to clipboard

Padding around the scrollbar indicator, providing space between the indicator and the track edges. Default is 0.dp.

Link copied to clipboard

Specifies the thickness of the scrollbar indicator (also known as the thumb), which is the part of the scrollbar that moves to indicate the current scroll position. Default is 8.dp.

Link copied to clipboard

Determines if the scrollbar indicator is draggable, allowing users to interact with it directly. Default is true.

Link copied to clipboard

Specifies the maximum length of the scrollbar indicator, preventing it from growing too large on short content. Default is Dp.Infinity, allowing the indicator to resize as needed.

Link copied to clipboard

Specifies the minimum length of the scrollbar indicator. This ensures the indicator remains visible even when content is long. Default is 24.dp.

Link copied to clipboard

Padding around the scrollbar as a whole. Allows adjusting spacing between the scrollbar and surrounding UI elements. Default is 0.dp for no additional padding.

Link copied to clipboard
val showAlways: Boolean = false

If true, the scrollbar is always visible, even when not actively scrolling. Default is false, meaning the scrollbar will auto-hide when not in use.