# CarouselDefaults

Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/carousel/Carousel.kt+class:androidx.compose.material3.carousel.CarouselDefaults) Common/All
- Cmn

  ```
  object CarouselDefaults
  ```

*** ** * ** ***

Contains the default values used by `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/package-summary#Carousel(androidx.compose.material3.carousel.CarouselState,androidx.compose.foundation.gestures.Orientation,kotlin.Function2,androidx.compose.foundation.layout.PaddingValues,kotlin.Int,androidx.compose.ui.Modifier,androidx.compose.ui.unit.Dp,androidx.compose.foundation.gestures.TargetedFlingBehavior,kotlin.Boolean,kotlin.Function2)`.

## Summary

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#multiBrowseFlingBehavior(androidx.compose.material3.carousel.CarouselState,androidx.compose.animation.core.DecayAnimationSpec,androidx.compose.animation.core.AnimationSpec)( state: https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselState, decayAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DecayAnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>, snapAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> )` A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` that flings without a limited distance and snaps to a final item according to the gesture's velocity. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#noSnapFlingBehavior()()` A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` that flings according to the gesture velocity and does not snap post-fling. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#singleAdvanceFlingBehavior(androidx.compose.material3.carousel.CarouselState,androidx.compose.animation.core.AnimationSpec)( state: https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselState, snapAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> )` A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` that limits a fling to one item at a time. | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/PaddingValues` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#ContentPadding()` The default padding around the content of a carousel. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#ItemSpacing()` The default space separating items in a carousel. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#MaxSmallItemSize()` The maximum size that a carousel strategy can choose its small items to be. \* | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#MinSmallItemSize()` The minimum size that a carousel strategy can choose its small items to be. \* | Cmn |

## Public functions

### multiBrowseFlingBehavior

Cmn

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

A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` that flings without a limited distance and snaps to a final item according to the gesture's velocity.

The Carousel may use `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#multiBrowseFlingBehavior(androidx.compose.material3.carousel.CarouselState,androidx.compose.animation.core.DecayAnimationSpec,androidx.compose.animation.core.AnimationSpec)` or `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#multiBrowseFlingBehavior(androidx.compose.material3.carousel.CarouselState,androidx.compose.animation.core.DecayAnimationSpec,androidx.compose.animation.core.AnimationSpec)` to approach the target item (calculated using the fling velocity) post-scroll. If the gesture has a high enough velocity to approach the target item, the Carousel will use `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#multiBrowseFlingBehavior(androidx.compose.material3.carousel.CarouselState,androidx.compose.animation.core.DecayAnimationSpec,androidx.compose.animation.core.AnimationSpec)` followed by `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#multiBrowseFlingBehavior(androidx.compose.material3.carousel.CarouselState,androidx.compose.animation.core.DecayAnimationSpec,androidx.compose.animation.core.AnimationSpec)` for the final step of the animation. If the gesture doesn't have enough velocity, it will use `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#multiBrowseFlingBehavior(androidx.compose.material3.carousel.CarouselState,androidx.compose.animation.core.DecayAnimationSpec,androidx.compose.animation.core.AnimationSpec)` to reach the snapped position.

| Parameters |
|---|---|
| `state: https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselState` | The `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselState` that controls which Carousel this TargetedFlingBehavior will be applied to. |
| `decayAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DecayAnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> = rememberSplineBasedDecay()` | The animation spec used to approach the target offset when the the fling velocity is large enough to naturally decay. |
| `snapAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> = spring(stiffness = Spring.StiffnessMediumLow)` | The animation spec used to finally snap to the position. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` | An instance of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` that performs flinging based on the gesture velocity and then snapping to the closest item post-fling. The animation will be governed by the post scroll velocity and the Carousel will use `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#multiBrowseFlingBehavior(androidx.compose.material3.carousel.CarouselState,androidx.compose.animation.core.DecayAnimationSpec,androidx.compose.animation.core.AnimationSpec)` to approach the snapped position |

### noSnapFlingBehavior

Cmn

```
@Composable
fun noSnapFlingBehavior(): TargetedFlingBehavior
```

A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` that flings according to the gesture velocity and does not snap post-fling.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` | An instance of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` that performs flinging based on the gesture velocity and does not snap to anything post-fling. |

### singleAdvanceFlingBehavior

Cmn

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

A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` that limits a fling to one item at a time. `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#singleAdvanceFlingBehavior(androidx.compose.material3.carousel.CarouselState,androidx.compose.animation.core.AnimationSpec)` can be used to control the snap animation.

| Parameters |
|---|---|
| `state: https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselState` | The `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselState` that controls which Carousel this TargetedFlingBehavior will be applied to. |
| `snapAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> = spring(stiffness = Spring.StiffnessMediumLow)` | The animation spec used to finally snap to the position. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` | An instance of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` that performs snapping to the next item. The animation will be governed by the post scroll velocity and the Carousel will use `https://developer.android.com/reference/kotlin/androidx/compose/material3/carousel/CarouselDefaults#singleAdvanceFlingBehavior(androidx.compose.material3.carousel.CarouselState,androidx.compose.animation.core.AnimationSpec)` to approach the snapped position |

## Public properties

### ContentPadding

Cmn

```
val ContentPadding: PaddingValues
```

The default padding around the content of a carousel.

### ItemSpacing

Cmn

```
val ItemSpacing: Dp
```

The default space separating items in a carousel.

### MaxSmallItemSize

Cmn

```
val MaxSmallItemSize: Dp
```

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

### MinSmallItemSize

Cmn

```
val MinSmallItemSize: Dp
```

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