Navigation bar
Give a view a title and a clear place in the application.
Installation
bunx --bun shadcn@latest add https://apple-ui-eduardo.vercel.app/r/navigation-bar.jsonThe registry includes the shared styles and dependencies. Import @/components/apple-ui/styles.css in your root layout once. For the package route, use the installation guide.
Usage
<NavigationBar
title="Workspace"
activeId="notes"
items={[{ id: 'notes', label: 'Notes', href: '/notes' }, { id: 'files', label: 'Files', href: '/files' }]}
/>Package imports use @eduardoul/apple-ui. Registry imports use @/components/apple-ui. Add "use client" to files that use state or event handlers.
API reference
| Property | Type | Default |
|---|---|---|
| title | ReactNode | undefined |
| items | NavigationItem[] | undefined |
| activeId | string | undefined |
| leading / trailing | ReactNode | undefined |
| variant | native | destinations | destinations with items, native with slots or without items |
Use className and style to customize the component. The package includes full TypeScript definitions for its supported element properties and refs.
Design guidance
- Keep navigation destinations stable.
- Use a title that explains the current context.
- Use leading and trailing for a centered title with controls on either side. Set variant to destinations for a row of links.
Accessibility
Provide a visible label or accessible name. Keep keyboard focus visible and check the example with your content at 200 percent zoom. Overlays use Radix for focus management and keyboard dismissal.
Library styles support reduced motion, reduced transparency, increased contrast and forced colors. Read the accessibility foundation for the checks your application still needs.