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.
label
string | Component
required
The button’s visible content. Can be a plain string or any component for custom layouts.
action
() => void
required
Callback invoked when the button is tapped.
When using the object form:
props.action
() => void
required
Callback invoked when the button is tapped.
props.label
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.
label
string
A text label displayed alongside the toggle switch.
isOn
boolean
required
The current state of the toggle.
setIsOn
(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.
value
number
required
The current value of the slider.
setValue
(value: number) => void
required
Callback invoked as the user drags the slider. Use this to update your state.
range
[number, number]
The slider’s range as [lowerBound, upperBound]. The convenient form for setting both bounds at once.
lowerBound
number
The minimum value. Use instead of range when setting only one bound.
upperBound
number
The maximum value. Use instead of range when setting only one bound.
step
number
The increment between selectable values. When omitted, the slider is continuous.
label
string
A text label describing what the slider controls. Some hosts display the label alongside the slider.
minimumValueLabel
Component
A component shown at the lower end of the slider, typically a small Text.
maximumValueLabel
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.
label
string
required
The label text for the picker.
selection
Binding<V>
required
A binding to the selected value, provided as a [value, setValue] tuple. The value type must be string or number.
children
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.
props.label
Component
required
The component displayed as the menu trigger. Typically a Button, Text, or Label.
children
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.
title
string | Component
required
The label text. Can be a plain string or a component for custom styling.
icon
Component
A custom icon component displayed alongside the title.
systemImage
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.
value
number
The current progress value. When provided, displays a determinate progress bar.
total
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