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.
Toggle
A switch control for toggling a boolean value on or off.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.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.A text label describing what the slider controls. Some hosts display the label alongside the slider.
Picker
A selection control for choosing from a set of mutually exclusive values.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.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.ProgressView
A view that shows progress toward completion of a task, either determinate or indeterminate.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