<div class='sourceset sourceset-common'>Common</div>

```kotlin
object SliderDefaults
```

Object to hold defaults used by [Slider](/jetpack-compose/androidx.compose.material3/material3/components/Slider)

## Properties

<div class='sourceset sourceset-common'>Common</div>

```kotlin
val TrackStopIndicatorSize: Dp
```

The default size for the stop indicator at the end of the track.

<div class='sourceset sourceset-common'>Common</div>

```kotlin
val TickSize: Dp
```

The default size for the ticks if steps are greater than 0.

## Functions

```kotlin
@Composable fun colors() = MaterialTheme.colorScheme.defaultSliderColors
```

Creates a [SliderColors](/jetpack-compose/androidx.compose.material3/material3/classes/SliderColors) that represents the different colors used in parts of the [Slider](/jetpack-compose/androidx.compose.material3/material3/components/Slider)
in different states.

<h2 id="colors-thumbcolor-activetrackcolor-activetickcolor-inactivetrackcolor-inactivetickcolor-disabledthumbcolor-disabledactivetrackcolor-disabledactivetickcolor-disabledinactivetrackcolor-disabledinactivetickcolor">colors</h2>

```kotlin
@Composable
    fun colors(
        thumbColor: Color = Color.Unspecified,
        activeTrackColor: Color = Color.Unspecified,
        activeTickColor: Color = Color.Unspecified,
        inactiveTrackColor: Color = Color.Unspecified,
        inactiveTickColor: Color = Color.Unspecified,
        disabledThumbColor: Color = Color.Unspecified,
        disabledActiveTrackColor: Color = Color.Unspecified,
        disabledActiveTickColor: Color = Color.Unspecified,
        disabledInactiveTrackColor: Color = Color.Unspecified,
        disabledInactiveTickColor: Color = Color.Unspecified,
    ): SliderColors
```

Creates a [SliderColors](/jetpack-compose/androidx.compose.material3/material3/classes/SliderColors) that represents the different colors used in parts of the [Slider](/jetpack-compose/androidx.compose.material3/material3/components/Slider)
in different states.

For the name references below the words "active" and "inactive" are used. Active part of the
slider is filled with progress, so if slider's progress is 30% out of 100%, left (or right in
RTL) 30% of the track will be active, while the rest is inactive.

#### Parameters

| | |
| --- | --- |
| thumbColor | thumb color when enabled |
| activeTrackColor | color of the track in the part that is "active", meaning that the thumb is ahead of it |
| activeTickColor | colors to be used to draw tick marks on the active track, if `steps` is specified |
| inactiveTrackColor | color of the track in the part that is "inactive", meaning that the thumb is before it |
| inactiveTickColor | colors to be used to draw tick marks on the inactive track, if `steps` are specified on the Slider is specified |
| disabledThumbColor | thumb colors when disabled |
| disabledActiveTrackColor | color of the track in the "active" part when the Slider is disabled |
| disabledActiveTickColor | colors to be used to draw tick marks on the active track when Slider is disabled and when `steps` are specified on it |
| disabledInactiveTrackColor | color of the track in the "inactive" part when the Slider is disabled |
| disabledInactiveTickColor | colors to be used to draw tick marks on the inactive part of the track when Slider is disabled and when `steps` are specified on it |

<hr class="docs-overload-divider">

<h2 id="thumb-interactionsource-modifier-colors-enabled-thumbsize">Thumb</h2>

```kotlin
@Composable
    fun Thumb(
        interactionSource: MutableInteractionSource,
        modifier: Modifier = Modifier,
        colors: SliderColors = colors(),
        enabled: Boolean = true,
        thumbSize: DpSize = ThumbSize,
    ) =
        Thumb(
            interactionSource = interactionSource,
            modifier = modifier,
            colors = colors,
            enabled = enabled,
            thumbSize = thumbSize,
            isVertical = false,
        )
```

The Default thumb for [Slider](/jetpack-compose/androidx.compose.material3/material3/components/Slider) and [RangeSlider](/jetpack-compose/androidx.compose.material3/material3/components/RangeSlider)

#### Parameters

| | |
| --- | --- |
| interactionSource | the [MutableInteractionSource](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/MutableInteractionSource) representing the stream of [Interaction](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Interaction)s for this thumb. You can create and pass in your own `remember`ed instance to observe |
| modifier | the [Modifier](/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier) to be applied to the thumb. |
| colors | [SliderColors](/jetpack-compose/androidx.compose.material3/material3/classes/SliderColors) that will be used to resolve the colors used for this thumb in different states. See [SliderDefaults.colors](/jetpack-compose/androidx.compose.material3/material3/objects/SliderDefaults). |
| enabled | controls the enabled state of this slider. When `false`, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |
| thumbSize | the size of the thumb. |

<hr class="docs-overload-divider">

<h2 id="thumb-interactionsource-sliderstate-modifier-colors-enabled-thumbsize">Thumb</h2>

```kotlin
@ExperimentalMaterial3ExpressiveApi
    @Composable
    fun Thumb(
        interactionSource: MutableInteractionSource,
        sliderState: SliderState,
        modifier: Modifier = Modifier,
        colors: SliderColors = colors(),
        enabled: Boolean = true,
        thumbSize: DpSize = ThumbSize,
    ) =
        Thumb(
            interactionSource = interactionSource,
            modifier = modifier,
            colors = colors,
            enabled = enabled,
            thumbSize = thumbSize,
            isVertical = sliderState.orientation == Vertical,
        )
```

The Default thumb for [Slider](/jetpack-compose/androidx.compose.material3/material3/components/Slider), [VerticalSlider](/jetpack-compose/androidx.compose.material3/material3/components/VerticalSlider) and [RangeSlider](/jetpack-compose/androidx.compose.material3/material3/components/RangeSlider)

#### Parameters

| | |
| --- | --- |
| interactionSource | the [MutableInteractionSource](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/MutableInteractionSource) representing the stream of [Interaction](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Interaction)s for this thumb. You can create and pass in your own `remember`ed instance to observe |
| sliderState | [SliderState](/jetpack-compose/androidx.compose.material3/material3/classes/SliderState) which is used to obtain the current active track. |
| modifier | the [Modifier](/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier) to be applied to the thumb. |
| colors | [SliderColors](/jetpack-compose/androidx.compose.material3/material3/classes/SliderColors) that will be used to resolve the colors used for this thumb in different states. See [SliderDefaults.colors](/jetpack-compose/androidx.compose.material3/material3/objects/SliderDefaults). |
| enabled | controls the enabled state of this slider. When `false`, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |
| thumbSize | the size of the thumb. |

<hr class="docs-overload-divider">

<h2 id="track-sliderpositions-modifier-colors-enabled">Track</h2>

```kotlin
@Composable
    
    fun Track(
        sliderPositions: SliderPositions,
        modifier: Modifier = Modifier,
        colors: SliderColors = colors(),
        enabled: Boolean = true,
    )
```

The Default track for [Slider](/jetpack-compose/androidx.compose.material3/material3/components/Slider) and [RangeSlider](/jetpack-compose/androidx.compose.material3/material3/components/RangeSlider)

#### Parameters

| | |
| --- | --- |
| sliderPositions | [SliderPositions](/jetpack-compose/androidx.compose.material3/material3/classes/SliderPositions) which is used to obtain the current active track and the tick positions if the slider is discrete. |
| modifier | the [Modifier](/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier) to be applied to the track. |
| colors | [SliderColors](/jetpack-compose/androidx.compose.material3/material3/classes/SliderColors) that will be used to resolve the colors used for this track in different states. See [SliderDefaults.colors](/jetpack-compose/androidx.compose.material3/material3/objects/SliderDefaults). |
| enabled | controls the enabled state of this slider. When `false`, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |

<hr class="docs-overload-divider">

<h2 id="track-sliderstate-modifier-enabled-colors-drawstopindicator-drawtick-thumbtrackgapsize-trackinsidecornersize">Track</h2>

```kotlin
@Composable
    fun Track(
        sliderState: SliderState,
        modifier: Modifier = Modifier,
        enabled: Boolean = true,
        colors: SliderColors = colors(),
        drawStopIndicator: (DrawScope.(Offset) -> Unit)? = {
            drawStopIndicator(
                offset = it,
                color = colors.trackColor(enabled, active = true),
                size = TrackStopIndicatorSize,
            )
        },
        drawTick: DrawScope.(Offset, Color) -> Unit = { offset, color ->
            drawStopIndicator(offset = offset, color = color, size = TickSize)
        },
        thumbTrackGapSize: Dp = ThumbTrackGapSize,
        trackInsideCornerSize: Dp = TrackInsideCornerSize,
    )
```

The Default track for [Slider](/jetpack-compose/androidx.compose.material3/material3/components/Slider)

#### Parameters

| | |
| --- | --- |
| sliderState | [SliderState](/jetpack-compose/androidx.compose.material3/material3/classes/SliderState) which is used to obtain the current active track. |
| modifier | the [Modifier](/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier) to be applied to the track. |
| enabled | controls the enabled state of this slider. When `false`, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |
| colors | [SliderColors](/jetpack-compose/androidx.compose.material3/material3/classes/SliderColors) that will be used to resolve the colors used for this track in different states. See [SliderDefaults.colors](/jetpack-compose/androidx.compose.material3/material3/objects/SliderDefaults). |
| drawStopIndicator | lambda that will be called to draw the stop indicator at the end of the track. |
| drawTick | lambda that will be called to draw the ticks if steps are greater than 0. |
| thumbTrackGapSize | size of the gap between the thumb and the track. |
| trackInsideCornerSize | size of the corners towards the thumb when a gap is set. |

<hr class="docs-overload-divider">

<h2 id="track-sliderstate-trackcornersize-modifier-enabled-colors-drawstopindicator-drawtick-thumbtrackgapsize-trackinsidecornersize">Track</h2>

```kotlin
@ExperimentalMaterial3ExpressiveApi
    @Composable
    fun Track(
        sliderState: SliderState,
        trackCornerSize: Dp,
        modifier: Modifier = Modifier,
        enabled: Boolean = true,
        colors: SliderColors = colors(),
        drawStopIndicator: (DrawScope.(Offset) -> Unit)? = {
            drawStopIndicator(
                offset = it,
                color = colors.trackColor(enabled, active = true),
                size = TrackStopIndicatorSize,
            )
        },
        drawTick: DrawScope.(Offset, Color) -> Unit = { offset, color ->
            drawStopIndicator(offset = offset, color = color, size = TickSize)
        },
        thumbTrackGapSize: Dp = ThumbTrackGapSize,
        trackInsideCornerSize: Dp = TrackInsideCornerSize,
    )
```

The Default track for [Slider](/jetpack-compose/androidx.compose.material3/material3/components/Slider) and [VerticalSlider](/jetpack-compose/androidx.compose.material3/material3/components/VerticalSlider)

This track has a different corner treatment where the corner size decreases as the thumb gets
closer.

#### Parameters

| | |
| --- | --- |
| sliderState | [SliderState](/jetpack-compose/androidx.compose.material3/material3/classes/SliderState) which is used to obtain the current active track. |
| trackCornerSize | size of the external corners. |
| modifier | the [Modifier](/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier) to be applied to the track. |
| enabled | controls the enabled state of this slider. When `false`, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |
| colors | [SliderColors](/jetpack-compose/androidx.compose.material3/material3/classes/SliderColors) that will be used to resolve the colors used for this track in different states. See [SliderDefaults.colors](/jetpack-compose/androidx.compose.material3/material3/objects/SliderDefaults). |
| drawStopIndicator | lambda that will be called to draw the stop indicator at the end of the track. |
| drawTick | lambda that will be called to draw the ticks if steps are greater than 0. |
| thumbTrackGapSize | size of the gap between the thumb and the track. |
| trackInsideCornerSize | size of the corners towards the thumb when a gap is set. |

<hr class="docs-overload-divider">

<h2 id="centeredtrack-sliderstate-modifier-enabled-colors-drawstopindicator-drawtick-thumbtrackgapsize-trackinsidecornersize-trackcornersize">CenteredTrack</h2>

```kotlin
@ExperimentalMaterial3ExpressiveApi
    @Composable
    fun CenteredTrack(
        sliderState: SliderState,
        modifier: Modifier = Modifier,
        enabled: Boolean = true,
        colors: SliderColors = colors(),
        drawStopIndicator: (DrawScope.(Offset) -> Unit)? = {
            drawStopIndicator(
                offset = it,
                color = colors.trackColor(enabled, active = true),
                size = TrackStopIndicatorSize,
            )
        },
        drawTick: DrawScope.(Offset, Color) -> Unit = { offset, color ->
            drawStopIndicator(offset = offset, color = color, size = TickSize)
        },
        thumbTrackGapSize: Dp = ThumbTrackGapSize,
        trackInsideCornerSize: Dp = TrackInsideCornerSize,
        trackCornerSize: Dp = Dp.Unspecified,
    )
```

The Default centered track for [Slider](/jetpack-compose/androidx.compose.material3/material3/components/Slider) and [VerticalSlider](/jetpack-compose/androidx.compose.material3/material3/components/VerticalSlider)

This track starts from the center of the slider.

#### Parameters

| | |
| --- | --- |
| sliderState | [SliderState](/jetpack-compose/androidx.compose.material3/material3/classes/SliderState) which is used to obtain the current active track. |
| modifier | the [Modifier](/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier) to be applied to the track. |
| enabled | controls the enabled state of this slider. When `false`, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |
| colors | [SliderColors](/jetpack-compose/androidx.compose.material3/material3/classes/SliderColors) that will be used to resolve the colors used for this track in different states. See [SliderDefaults.colors](/jetpack-compose/androidx.compose.material3/material3/objects/SliderDefaults). |
| drawStopIndicator | lambda that will be called to draw the stop indicator at the end of the track. |
| drawTick | lambda that will be called to draw the ticks if steps are greater than 0. |
| thumbTrackGapSize | size of the gap between the thumb and the track. |
| trackInsideCornerSize | size of the corners towards the thumb when a gap is set. |
| trackCornerSize | size of the external corners. |

<hr class="docs-overload-divider">

<h2 id="track-rangesliderstate-modifier-colors-enabled">Track</h2>

```kotlin
@Composable
    fun Track(
        rangeSliderState: RangeSliderState,
        modifier: Modifier = Modifier,
        colors: SliderColors = colors(),
        enabled: Boolean = true,
    )
```

The Default track for [RangeSlider](/jetpack-compose/androidx.compose.material3/material3/components/RangeSlider)

#### Parameters

| | |
| --- | --- |
| rangeSliderState | [RangeSliderState](/jetpack-compose/androidx.compose.material3/material3/classes/RangeSliderState) which is used to obtain the current active track. |
| modifier | the [Modifier](/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier) to be applied to the track. |
| colors | [SliderColors](/jetpack-compose/androidx.compose.material3/material3/classes/SliderColors) that will be used to resolve the colors used for this track in different states. See [SliderDefaults.colors](/jetpack-compose/androidx.compose.material3/material3/objects/SliderDefaults). |
| enabled | controls the enabled state of this slider. When `false`, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |

<hr class="docs-overload-divider">

<h2 id="track-rangesliderstate-modifier-enabled-colors-drawstopindicator-drawtick-thumbtrackgapsize-trackinsidecornersize">Track</h2>

```kotlin
@Composable
    fun Track(
        rangeSliderState: RangeSliderState,
        modifier: Modifier = Modifier,
        enabled: Boolean = true,
        colors: SliderColors = colors(),
        drawStopIndicator: (DrawScope.(Offset) -> Unit)? = {
            drawStopIndicator(
                offset = it,
                color = colors.trackColor(enabled, active = true),
                size = TrackStopIndicatorSize,
            )
        },
        drawTick: DrawScope.(Offset, Color) -> Unit = { offset, color ->
            drawStopIndicator(offset = offset, color = color, size = TickSize)
        },
        thumbTrackGapSize: Dp = ThumbTrackGapSize,
        trackInsideCornerSize: Dp = TrackInsideCornerSize,
    )
```

The Default track for [RangeSlider](/jetpack-compose/androidx.compose.material3/material3/components/RangeSlider)

#### Parameters

| | |
| --- | --- |
| rangeSliderState | [RangeSliderState](/jetpack-compose/androidx.compose.material3/material3/classes/RangeSliderState) which is used to obtain the current active track. |
| modifier | the [Modifier](/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier) to be applied to the track. |
| enabled | controls the enabled state of this slider. When `false`, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |
| colors | [SliderColors](/jetpack-compose/androidx.compose.material3/material3/classes/SliderColors) that will be used to resolve the colors used for this track in different states. See [SliderDefaults.colors](/jetpack-compose/androidx.compose.material3/material3/objects/SliderDefaults). |
| drawStopIndicator | lambda that will be called to draw the stop indicator at the start/end of the track. |
| drawTick | lambda that will be called to draw the ticks if steps are greater than 0. |
| thumbTrackGapSize | size of the gap between the thumbs and the track. |
| trackInsideCornerSize | size of the corners towards the thumbs when a gap is set. |

<hr class="docs-overload-divider">

<h2 id="track-rangesliderstate-trackcornersize-modifier-enabled-colors-drawstopindicator-drawtick-thumbtrackgapsize-trackinsidecornersize">Track</h2>

```kotlin
@ExperimentalMaterial3ExpressiveApi
    @Composable
    fun Track(
        rangeSliderState: RangeSliderState,
        trackCornerSize: Dp,
        modifier: Modifier = Modifier,
        enabled: Boolean = true,
        colors: SliderColors = colors(),
        drawStopIndicator: (DrawScope.(Offset) -> Unit)? = {
            drawStopIndicator(
                offset = it,
                color = colors.trackColor(enabled, active = true),
                size = TrackStopIndicatorSize,
            )
        },
        drawTick: DrawScope.(Offset, Color) -> Unit = { offset, color ->
            drawStopIndicator(offset = offset, color = color, size = TickSize)
        },
        thumbTrackGapSize: Dp = ThumbTrackGapSize,
        trackInsideCornerSize: Dp = TrackInsideCornerSize,
    )
```

The Default track for [RangeSlider](/jetpack-compose/androidx.compose.material3/material3/components/RangeSlider)

#### Parameters

| | |
| --- | --- |
| rangeSliderState | [RangeSliderState](/jetpack-compose/androidx.compose.material3/material3/classes/RangeSliderState) which is used to obtain the current active track. |
| trackCornerSize | size of the external corners. |
| modifier | the [Modifier](/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier) to be applied to the track. |
| enabled | controls the enabled state of this slider. When `false`, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |
| colors | [SliderColors](/jetpack-compose/androidx.compose.material3/material3/classes/SliderColors) that will be used to resolve the colors used for this track in different states. See [SliderDefaults.colors](/jetpack-compose/androidx.compose.material3/material3/objects/SliderDefaults). |
| drawStopIndicator | lambda that will be called to draw the stop indicator at the start/end of the track. |
| drawTick | lambda that will be called to draw the ticks if steps are greater than 0. |
| thumbTrackGapSize | size of the gap between the thumbs and the track. |
| trackInsideCornerSize | size of the corners towards the thumbs when a gap is set. |

<hr class="docs-overload-divider">

<h2 id="drawstopindicator-offset-size-color">drawStopIndicator</h2>

```kotlin
fun DrawScope.drawStopIndicator(offset: Offset, size: Dp, color: Color)
```

The Default stop indicator.

#### Parameters

| | |
| --- | --- |
| offset | the coordinate where the indicator is to be drawn. |
| size | the size of the indicator. |
| color | the color of the indicator. |