androidx.compose.material3.carousel

CarouselDefaults

Object

No hand-written docs yet.

Contains the default values used by Carousel.

object CarouselDefaults

Properties

MinSmallItemSizeSince 1.9

val MinSmallItemSize: Dp

The minimum size that a carousel strategy can choose its small items to be. *

MaxSmallItemSizeSince 1.9

val MaxSmallItemSize: Dp

The maximum size that a carousel strategy can choose its small items to be. *

Functions

singleAdvanceFlingBehavior

@Composable
fun singleAdvanceFlingBehavior(
    state: CarouselState,
    snapAnimationSpec: AnimationSpec<Float> = spring(stiffness = Spring.StiffnessMediumLow),
): TargetedFlingBehavior

A TargetedFlingBehavior that limits a fling to one item at a time. snapAnimationSpec can be used to control the snap animation.

multiBrowseFlingBehavior

@Composable
fun multiBrowseFlingBehavior(
    state: CarouselState,
    decayAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay(),
    snapAnimationSpec: AnimationSpec<Float> = spring(stiffness = Spring.StiffnessMediumLow),
): TargetedFlingBehavior

A TargetedFlingBehavior that flings without a limited distance and snaps to a final item according to the gesture's velocity.

noSnapFlingBehavior

@Composable
fun noSnapFlingBehavior(): TargetedFlingBehavior

A TargetedFlingBehavior that flings according to the gesture velocity and does not snap post-fling.

Library docs

Contains the default values used by Carousel.