Navigation/DSTabs
DSTabs
navigationTab bar with icon, label, and badge support. Uses spring animations for the active indicator.
iOS 17+macOS 14+
Purpose
Top-level navigation between 2–5 primary sections of an app.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| itemsreq | [DSTabItem] | — | Tab items with id, label, and icon. |
| selectedreq | Binding<String> | — | ID of the active tab. |
| style | DSTabStyle | .bar | .bar (bottom) or .underline (top). |
Examples
Primary app navigation
4-tab bottom navigation.
swift
DSTabs(
items: [
DSTabItem(id: "home", label: "Home", icon: "house.fill"),
DSTabItem(id: "search", label: "Search", icon: "magnifyingglass"),
DSTabItem(id: "projects", label: "Projects", icon: "folder.fill"),
DSTabItem(id: "profile", label: "Profile", icon: "person.fill"),
],
selected: $selectedTab
)