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.The button’s visible content. Can be a plain string or any component for custom layouts.
Callback invoked when the button is tapped.
Callback invoked when the button is tapped.
A component to use as the button label.
Toggle
A switch control for toggling a boolean value on or off.A text label displayed alongside the toggle switch.
The current state of the toggle.
Callback invoked when the user taps the toggle. Use this to update your state.
Slider
A continuous control for selecting a numeric value within a range.The current value of the slider.
Callback invoked as the user drags the slider. Use this to update your state.
The slider’s range as
[lowerBound, upperBound]. The convenient form for setting both bounds at once.The minimum value. Use instead of
range when setting only one bound.The maximum value. Use instead of
range when setting only one bound.The increment between selectable values. When omitted, the slider is continuous.
A text label describing what the slider controls. Some hosts display the label alongside the slider.
A component shown at the lower end of the slider, typically a small
Text.A component shown at the upper end of the slider.
Picker
A selection control for choosing from a set of mutually exclusive values.The label text for the picker.
A binding to the selected value, provided as a
[value, setValue] tuple. The value type must be string or number.An array of picker options. Each child should have a
.tag() modifier to identify its value.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.Menu
A dropdown menu of actions that appears when the label is tapped.The component displayed as the menu trigger. Typically a Button, Text, or Label.
An array of menu items. Typically Button components, with optional Divider separators and nested Menu components for submenus.
Label
A standard label combining a title with an optional icon.The label text. Can be a plain string or a component for custom styling.
A custom icon component displayed alongside the title.
A system symbol name (SF Symbols) to use as the icon. Mutually exclusive with
icon.ProgressView
A view that shows progress toward completion of a task, either determinate or indeterminate.The current progress value. When provided, displays a determinate progress bar.
The value that represents full completion. Defaults to
1, so value is treated as a fraction (0 to 1).See also
- NavigationLink — navigation trigger that pairs with a Label
- ContextMenu — menu triggered by long press
- PickerStyle — picker style options
- TextField — single-line input alongside controls in a form
- Text — read-only text display