Slider Color
Customizing the color of the slider
Platform Compatibility
Tags
SwiftUI Code
@State private var speed = 42.0
@State private var isEditing = false
var body: some View {
VStack {
Slider(
value: $speed,
in: 0 ... 100,
step: 2 // optional, by default 1,
)
Slider(
value: $speed,
in: 0 ... 100,
step: 2 // optional, by default 1,
) {
Text("Foo") // for accessibility
} minimumValueLabel: {
Text("0")
} maximumValueLabel: {
Text("100")
} onEditingChanged: { editing in
isEditing = editing
}
}
.tint(.red)
}Found an issue or have a suggestion?
More Slider Components
View allSliderTickContentForEach
A type of slider content that creates content by iterating over a collection.
Custom Slider Ticks
Creates a slider to select a value from a given range, subject to a step increment, which displays the provided labels and customizable ticks.
Stepped Min Max Label Slider
Creates a slider to select a value from a given range, subject to a step increment, which displays the provided labels
Stepped Slider
Creates a slider to select a value from a given range, subject to a step increment
Explore Other Components
Browse allInsetGroupedListStyle
The list style that describes the behavior and appearance of an inset grouped list.
ContainerRelativeShape
A shape that is replaced by an inset version of the current container shape. If no container shape was defined, is replaced by a rectangle
Outline Group
A structure that computes views and disclosure groups on demand from an underlying collection of tree-structured, identified data.