SweetUI

Search items

Jump to an item

component

accordion

Styles DisclosureGroup: full-width header, trailing chevron; keeps caller styling.

accordiondisclosurecollapsibleexpandfaqshadcn
accordion, light

On iPad

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

accordion on iPad, light

Install

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

sweetui install accordion --destination Sources/YourFeature/Components

Installs in order: separator 0.2.1, accordion 0.2.2. Point --destination at a folder inside the consuming target's sources.

Usage

@State private var isExpanded = false

DisclosureGroup("How do I freeze my card?", isExpanded: $isExpanded) {
    Text("Open the card, then choose Freeze.")
}
.disclosureGroupStyle(.registryAccordion)

Accessibility contract

  • Header: plain Button bound to isExpanded.
  • Value: Expanded/Collapsed, no selection trait, one-word VoiceOver.
  • Chevron decorative, hidden; header keeps 44 point minimum height.
  • Tap: snappy curve; Reduce Motion immediate; code-driven uses caller's animation.
  • iPad: plain style drops automatic pointer effect; hoverEffect restores, shape auto-picked.

Details

Kindcomponent
Version0.2.2
PlatformsiOS 26.0+
Dependenciesseparator
SourceRegistry/sources/components/RegistryAccordionStyle.swift
Xcode previewAccordion