Skip to main content
The interactive control primitives. Button performs an action on tap. Toggle flips a boolean. Picker selects one value from a set, and Menu shows a dropdown list of actions. Label is a title-plus-icon combination commonly used as a button or row label, and ProgressView displays determinate or indeterminate progress.

Button

A tappable control that performs an action when pressed.
string | Component
required
The button’s visible content. Can be a plain string or any component for custom layouts.
() => void
required
Callback invoked when the button is tapped.
When using the object form:
() => void
required
Callback invoked when the button is tapped.
Component
required
A component to use as the button label.
Simple text button
Button with component label
Object form
Styled button
Disabled button

Toggle

A switch control for toggling a boolean value on or off.
string
A text label displayed alongside the toggle switch.
boolean
required
The current state of the toggle.
(value: boolean) => void
required
Callback invoked when the user taps the toggle. Use this to update your state.
Basic toggle
With tint color
Settings list

Slider

A continuous control for selecting a numeric value within a range.
number
required
The current value of the slider.
(value: number) => void
required
Callback invoked as the user drags the slider. Use this to update your state.
[number, number]
The slider’s range as [lowerBound, upperBound]. The convenient form for setting both bounds at once.
number
The minimum value. Use instead of range when setting only one bound.
number
The maximum value. Use instead of range when setting only one bound.
number
The increment between selectable values. When omitted, the slider is continuous.
string
A text label describing what the slider controls. Some hosts display the label alongside the slider.
Component
A component shown at the lower end of the slider, typically a small Text.
Component
A component shown at the upper end of the slider.
Basic slider
Stepped slider with labels
Bounded with lowerBound and upperBound

Picker

A selection control for choosing from a set of mutually exclusive values.
string
required
The label text for the picker.
Binding<V>
required
A binding to the selected value, provided as a [value, setValue] tuple. The value type must be string or number.
Component[]
required
An array of picker options. Each child should have a .tag() modifier to identify its value.
Basic picker
Segmented picker
Picker in a form
With ForEach
Each child must have a .tag() value matching the type of the selection binding. Style the picker with .pickerStyle() using values like "menu", "segmented", "wheel", or "inline". See PickerStyle.
A dropdown menu of actions that appears when the label is tapped.
Component
required
The component displayed as the menu trigger. Typically a Button, Text, or Label.
Component[]
required
An array of menu items. Typically Button components, with optional Divider separators and nested Menu components for submenus.
Simple menu
Menu with icon label
Nested submenu
Menu with button items using icons

Label

A standard label combining a title with an optional icon.
string | Component
required
The label text. Can be a plain string or a component for custom styling.
Component
A custom icon component displayed alongside the title.
string
A system symbol name (SF Symbols) to use as the icon. Mutually exclusive with icon.
Label with system image
Label with custom icon
Label with styled title
Labels in a list

ProgressView

A view that shows progress toward completion of a task, either determinate or indeterminate.
number
The current progress value. When provided, displays a determinate progress bar.
number
default:"1"
The value that represents full completion. Defaults to 1, so value is treated as a fraction (0 to 1).
Indeterminate spinner When called with no arguments, displays an indeterminate spinning indicator.
Determinate progress bar
Custom total
With label

See also