Interactive previews iPhone

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.

Custom Slider Ticks - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 26.0+ iPadOS 26.0+ macOS 26.0+ watchOS 26.0+ visionOS 26.0+

Tags

SwiftUI Code

Docs
@State private var speed = 42.0
    
var body: some View {
        Slider(value: $speed) {
            Text("Foo")
        } ticks: {
            SliderTick(0.2)
            SliderTick(0.6)
            SliderTick(0.8)
        }
    }

Found an issue or have a suggestion?

Created: June 10, 2025Updated: December 27, 2025

More Slider Components

View all
SliderTickContentForEach - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

SliderTickContentForEach

A type of slider content that creates content by iterating over a collection.

Slider Color - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Slider Color

Customizing the color of the slider

Stepped Min Max Label Slider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

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 - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Stepped Slider

Creates a slider to select a value from a given range, subject to a step increment

Slider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Slider

Creates a slider to select a value from a given range

Explore Other Components

Browse all
GroupBox - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

GroupBox

A simple GroupBox

Subscription Store View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Subscription Store View

Creates a view that loads subscriptions based on a collection of product identifiers, and merchandises them with automatic marketing content.

Horizontal Radio Group Layout - macOS - Liquid Glass - Light Mode - Preview
modifier

Horizontal Radio Group Layout

Sets the style for radio group style pickers within this view to be horizontally positioned with the radio buttons inside the layout.

PalettePickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

PalettePickerStyle

A picker style that presents the options as a row of compact elements. When used outside of menus, this style is rendered as a segmented picker. If that is the intended usage, consider segmented instead.

ToolbarSpacer - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

ToolbarSpacer

A standard space item in toolbars

InlinePickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

InlinePickerStyle

A PickerStyle where each option is displayed inline with other views in the current container.

ToolbarItem Shared Background Visibility - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

ToolbarItem Shared Background Visibility

Controls the visibility of the glass background effect on items in the toolbar. In certain contexts, such as the navigation bar on iOS and the window toolbar on macOS, toolbar items will be given a glass background effect that is shared with other items in the same logical grouping

Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Picker

Creates a pickers with title, image, systemImage, and custom label.