SweetUI

Search items

Jump to an item

component

toggle

Button treatment, Toggle.

togglebuttonselectionformattingstyle
toggle, light

On iPad

The same installed source at a regular width. It adapts its layout without a separate design.

toggle on iPad, light

Install

With the sweetui tool (brew install mangobyte-dev/tap/sweetui):

sweetui install toggle --destination Sources/YourFeature/Components

Installs in order: button 0.5.2, toggle 0.2.1. Point --destination at a folder inside the consuming target's sources.

Usage

// Content layer only. In toolbars, tab bars, or floating chrome the system supplies Liquid Glass; use .buttonStyle(.glass) or .buttonStyle(.glassProminent) there instead of .registry styles.

@State private var bold = false

Toggle("Bold", systemImage: "bold", isOn: $bold)
    .toggleStyle(.registryToggle)

Accessibility contract

  • State, activation retained.
  • Icon-only needs labels.
  • Opacity, selected beyond color.
  • Dynamic Type, enabled, size, direction.

Details

Kindcomponent
Version0.2.1
PlatformsiOS 26.0+
Dependenciesbutton
SourceRegistry/sources/components/RegistryToggleStyle.swift
Xcode previewToggle