When to use it
Use it for formatting or view options. Use a toggle switch for settings.
Apple availability
Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.
Native example
Use it for formatting or view options. Use a toggle switch for settings.
import LumenUI
import SwiftUI
struct ToggleButtonExample: View {
@State private var isBold = true
@State private var isItalic = false
var body: some View {
HStack {
LumenToggleButton("Bold", isPressed: $isBold)
LumenToggleButton("Italic", isPressed: $isItalic, icon: .italic, iconOnly: true)
LumenToggleButton("Unavailable", isPressed: .constant(false), disabled: true)
}
}
}Reference
The primary shared and platform-specific options exposed by LumenToggleButton.
| API | Values or type | Default | Description |
|---|---|---|---|
| isPressed / label / icon | controlled state / name / leading icon | required / required / none | Use it for formatting or view options. |
Native behavior
Use it for formatting or view options. Use a toggle switch for settings.
Exposes pressed state; icon-only buttons keep the label as their name.
Shared component