ScrollIndicator
Composable Component
A composable that displays a visual indicator of scrolling progress within a scrollable container.
Android
@Composable
public fun ScrollIndicator(
state: ScrollState,
modifier: Modifier = Modifier,
colors: ScrollIndicatorColors = ScrollIndicatorDefaults.colors(),
reverseDirection: Boolean = false,
positionAnimationSpec: AnimationSpec<Float> = ScrollIndicatorDefaults.PositionAnimationSpec,
)
Parameters
state | The scrollState to use as the basis for the ScrollIndicatorState. |
modifier | The modifier to be applied to the component - usually set to Modifier.align(Alignment.CenterEnd) . |
colors | ScrollIndicatorColors that will be used to resolve the indicator and track colors for this ScrollIndicator . |
reverseDirection | Reverses direction of ScrollIndicator if true |
positionAnimationSpec | AnimationSpec for position animation. The Position animation is used for animating changes to the scroll size and position. To disable this animation snap AnimationSpec should be passed instead. |
Android
@Composable
public fun ScrollIndicator(
state: ScalingLazyListState,
modifier: Modifier = Modifier,
colors: ScrollIndicatorColors = ScrollIndicatorDefaults.colors(),
reverseDirection: Boolean = false,
positionAnimationSpec: AnimationSpec<Float> = ScrollIndicatorDefaults.PositionAnimationSpec,
)
Parameters
state | the ScalingLazyListState to use as the basis for the ScrollIndicatorState. |
modifier | The modifier to be applied to the component |
colors | ScrollIndicatorColors that will be used to resolve the indicator and track colors for this ScrollIndicator . |
reverseDirection | Reverses direction of ScrollIndicator if true |
positionAnimationSpec | AnimationSpec for position animation. The Position animation is used for animating changes to the scroll size and position. To disable this animation snap AnimationSpec should be passed instead. |
Android
@Composable
public fun ScrollIndicator(
state: TransformingLazyColumnState,
modifier: Modifier = Modifier,
colors: ScrollIndicatorColors = ScrollIndicatorDefaults.colors(),
reverseDirection: Boolean = false,
positionAnimationSpec: AnimationSpec<Float> = ScrollIndicatorDefaults.PositionAnimationSpec,
)
Parameters
state | the TransformingLazyColumnState to use as the basis for the ScrollIndicatorState. |
modifier | The modifier to be applied to the component |
colors | ScrollIndicatorColors that will be used to resolve the indicator and track colors for this ScrollIndicator . |
reverseDirection | Reverses direction of ScrollIndicator if true |
positionAnimationSpec | AnimationSpec for position animation. The Position animation is used for animating changes to the scroll size and position. To disable this animation snap AnimationSpec should be passed instead. |
Android
@Composable
public fun ScrollIndicator(
state: LazyListState,
modifier: Modifier = Modifier,
colors: ScrollIndicatorColors = ScrollIndicatorDefaults.colors(),
reverseDirection: Boolean = false,
positionAnimationSpec: AnimationSpec<Float> = ScrollIndicatorDefaults.PositionAnimationSpec,
)
Parameters
state | the LazyListState to use as the basis for the ScrollIndicatorState. |
modifier | The modifier to be applied to the component |
colors | ScrollIndicatorColors that will be used to resolve the indicator and track colors for this ScrollIndicator . |
reverseDirection | Reverses direction of ScrollIndicator if true |
positionAnimationSpec | AnimationSpec for position animation. The Position animation is used for animating changes to the scroll size and position. To disable this animation snap AnimationSpec should be passed instead. |
Create your own Component Library
Material Components are meant to be used as is and they do not allow customizations. To build your own Jetpack Compose component library use Compose Unstyled