Vertical slider

A slider that runs top to bottom, for levels, equalizers and mixers.

When to use

Use a vertical slider when the value is a level or amount that people compare across several controls, such as an equalizer. It is driven by a SliderState instead of a value and a callback.

Playground

The interactive page has a playground with live property controls for this component and generated code.

Examples

Equalizer

Row(horizontalArrangement = Arrangement.spacedBy(24.dp)) {
    listOf("Bass", "Mid", "Treble").forEach { label ->
        androidx.compose.foundation.layout.Column(horizontalAlignment = androidx.compose.ui.Alignment.CenterHorizontally) {
            VerticalSlider(state = rememberSliderState(value = 0.5f), modifier = Modifier.height(160.dp))
            Text(label)
        }
    }
}

Parameters

NameTypeDefaultDescription
stateSliderStaterememberSliderState(value, steps, valueRange).
reverseDirectionBooleanfalsePuts the minimum at the top.
modifierModifierModifierGive the slider a height.

Guidelines

Do:

Don't:

Accessibility

Related components