Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
FormsApple

Toggle

Present a labeled native switch with Lumen brand tint.

Public APILumenToggleApple / SwiftUISwift product: LumenUI

Apple availability

Supported native targets

Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.

iPhone · iOS 16+iPad · iPadOS 16+Mac · macOS 13+Apple Vision · visionOS 1+

Native example

Use Toggle

Use for an immediately applied Boolean setting. Use a button when an action does not represent persistent on/off state.

Toggle rendered in the iPhone simulator Lumen playground
Verified runtime captureiPhone simulator
swift
LumenToggle("Automatic updates", isOn: $automaticUpdates)

Reference

Public API

The primary shared and platform-specific options exposed by LumenToggle.

APIValues or typeDefaultDescription
isOnBinding<Bool>RequiredStores native on/off state.
labelLocalizedStringKey or custom ViewRequiredProvides the visible and accessible label.
Binding setter(Boolean) -> UnitRequiredUpdates the controlled state.
.labelsHidden()BooleantrueCan visually hide a repeated label while preserving its accessible name.
enabledBooleantrueControls native disabled state.

Native behavior

Design and accessibility

When to use it

Use for an immediately applied Boolean setting. Use a button when an action does not represent persistent on/off state.

Accessibility

The visible label and native switch expose standard platform state and activation behavior.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package