Navigation/DSNavigationBar
DSNavigationBar
navigationApp navigation bar with a title, optional back button, and leading/trailing icon button slots.
iOS 17+macOS 14+
Purpose
Top-level screen header in all non-tab navigation contexts.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| titlereq | String | โ | Screen title. |
| showBack | Bool | false | Shows a back chevron. |
| onBack | (() -> Void)? | nil | Back button action. |
| leadingItems | [DSNavBarItem] | [] | Leading icon buttons. |
| trailingItems | [DSNavBarItem] | [] | Trailing icon buttons. |
Examples
Screen header with actions
Detail screen header.
swift
DSNavigationBar(
title: "Project Details",
showBack: true,
onBack: { dismiss() },
trailingItems: [
DSNavBarItem(icon: "square.and.arrow.up", action: { share() }),
DSNavBarItem(icon: "ellipsis", action: { showMenu = true }),
]
)