SweetUI

Search items

Jump to an item

recipe

switch

Toggle: switch style; inherits tint, environment.

switchtogglesettingbooleanguidance
switch, light

On iPad

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

switch on iPad, light

Install

Usage

@State private var notifications = true

Toggle("Notifications", isOn: $notifications)
    .toggleStyle(.switch)
    .registryItem("switch")

Why native is enough

.toggleStyle(.switch) on Toggle; no wrapper.

Accessibility contract

  • Retains Toggle semantics, announcements; needs visible/accessibility label.
  • Inherits tint, enabled, Dynamic Type, direction; no interaction/animation changes.

Details

Kindrecipe
Version0.3.1
PlatformsiOS 26.0+
Dependenciesnone
Sourcenone (native guidance)