Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Apple docs
LayoutApple

Accordion

Stack disclosure sections with single or multiple expansion.

Public APILumenAccordionApple / 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 Accordion

Use single mode for one open section at a time. Keep titles short and put detail in the body.

Accordion rendered in the iPhone simulator Lumen playground
Captured exampleiPhone simulatorView dark appearance
swift
import LumenUI
import SwiftUI

struct AccordionExample: View {
    @State private var expanded: Set<String> = ["platforms"]

    private let items: [LumenAccordionItem] = [
        .init(id: "platforms", title: "Where can I use Lumen?"),
        .init(id: "themes", title: "Can I customize the theme?"),
        .init(id: "archive", title: "Archived guidance", isDisabled: true)
    ]

    var body: some View {
        LumenAccordion(items: items, expanded: $expanded, mode: .single) { item in
            LumenText(.verbatim(item.id == "platforms"
                ? "Use the same component vocabulary on web, iPhone, iPad and Mac."
                : "Adjust the semantic tokens to match your product."))
        }
    }
}
Apple
A single-expansion FAQ accordion with one disabled section, controlled through a bound set of expanded IDs.

Reference

Public API

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

APIValues or typeDefaultDescription
items / mode / variantsections / single or multiple / card, flush, or hairlinerequired / multiple / defaultUse single mode for one open section at a time.

Native behavior

Design and accessibility

When to use it

Use single mode for one open section at a time. Keep titles short and put detail in the body.

Accessibility

Each header is a button with expanded state; collapsed content is hidden.

Shared component

Available on other platforms

React NativeAndroid / Compose Web
Apple docsSwiftUI package