Navigation/DSTabs

DSTabs

navigation
since v1.0

Tab 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.

Interactive Reference

Live showroom

Need the full visual surface?

Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().

Best for exploring:

variants, states, categories, and real app examples in one place.

Props

PropTypeDefaultDescription
itemsreq[DSTabItem]Tab items with id, label, and icon.
selectedreqBinding<String>ID of the active tab.
styleDSTabStyle.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
)

Related Components