Navigation/DSSidebar
DSSidebar
navigationCollapsible navigation sidebar for macOS and iPad with section grouping and active-state indicator.
macOS 14+iOS 17+ (iPad)
Purpose
Primary navigation for content-rich macOS apps and iPad split-view layouts.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| sectionsreq | [DSSidebarSection] | — | Nav sections with title and items. |
| selectedreq | Binding<String?> | — | ID of the active item. |
| isCollapsedreq | Binding<Bool> | — | Collapsed / expanded state. |
Examples
macOS app nav
Two-section sidebar with active state.
swift
DSSidebar(
sections: [
DSSidebarSection(title: "Workspace", items: [
DSSidebarItem(id: "dashboard", label: "Dashboard", icon: "house"),
DSSidebarItem(id: "projects", label: "Projects", icon: "folder"),
]),
DSSidebarSection(title: "Account", items: [
DSSidebarItem(id: "settings", label: "Settings", icon: "gearshape"),
]),
],
selected: $selectedItem,
isCollapsed: $isSidebarCollapsed
)