When to use it
Use single mode for one open section at a time. Keep titles short and put detail in the body.
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 single mode for one open section at a time. Keep titles short and put detail in the body.
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."))
}
}
}Reference
The primary shared and platform-specific options exposed by LumenAccordion.
| API | Values or type | Default | Description |
|---|---|---|---|
| items / mode / variant | sections / single or multiple / card, flush, or hairline | required / multiple / default | Use single mode for one open section at a time. |
Native behavior
Use single mode for one open section at a time. Keep titles short and put detail in the body.
Each header is a button with expanded state; collapsed content is hidden.
Shared component