Navigation Bar
NavigationBar is the app's top bar: the menu button and logo, the page links or the path to the current page, and the tools that apply on every page.
import { RiBarChartLine, RiBox3Line, RiHome5Line, RiMenuLine, RiNotification3Line, RiSettings3Line } from '@remixicon/react';
import { IconButton } from '@/components/ui/wideset/button/IconButton';
import { NavigationBar } from '@/components/ui/wideset/navigation-bar/NavigationBar';
<div className="w-[40rem] max-w-full">
<NavigationBar>
<NavigationBar.Start>
<IconButton
variant="secondary"
preset="ghost"
size="sm"
icon={RiMenuLine}
aria-label="Open menu"
/>
<Logo />
</NavigationBar.Start>
<NavigationBar.Nav>
<NavigationBar.Item href="#" active>
<NavigationBar.Icon icon={RiHome5Line} />
<NavigationBar.Label>Dashboard</NavigationBar.Label>
</NavigationBar.Item>
<NavigationBar.Item href="#">
<NavigationBar.Icon icon={RiBarChartLine} />
<NavigationBar.Label>Analytics</NavigationBar.Label>
</NavigationBar.Item>
<NavigationBar.Item href="#">
<NavigationBar.Icon icon={RiBox3Line} />
<NavigationBar.Label>Products</NavigationBar.Label>
</NavigationBar.Item>
</NavigationBar.Nav>
<NavigationBar.End>
<NavigationBar.Actions>
<IconButton
variant="secondary"
preset="ghost"
size="sm"
icon={RiSettings3Line}
aria-label="Settings"
/>
<IconButton
variant="secondary"
preset="ghost"
size="sm"
icon={RiNotification3Line}
aria-label="Notifications"
/>
</NavigationBar.Actions>
</NavigationBar.End>
</NavigationBar>
</div>
);
}
/** Your logo goes here; this is the Wideset mark on its tile. */
function Logo() {
return (
<span className="bg-ws-static-alpha-strong text-ws-static-strong rounded-ws-control-lg size-ws-14 flex shrink-0 items-center justify-center">
<svg
viewBox="0 0 16 8"
role="img"
aria-label="Wideset"
className="h-ws-5 w-ws-9 fill-current"
>
<path d="M13.69 0s-2.07 5.32-2.15 5.52C11.5 5.42 9.18 0 9.18 0H7.09S4.78 5.52 4.74 5.59C4.7 5.52 2.24 0 2.24 0H0l3.74 8h2.06l2.35-5.66h.04c.02.06 2.39 5.66 2.39 5.66h2.12S15.98.07 16 0z" />
</svg>
</span>Installation
pnpm dlx wideset add navigation-bar
Copies the component and any Wideset components it uses into your project.
Examples
Divider
The line under the bar is on by default. Keep it when the page starts right below with a compact header, a toolbar or a table. Turn it off with divider={false} when the page opens with a large title, which sets the bar apart on its own, or when the bar sits on a grey page above white cards.
import { RiBarChartLine, RiBox3Line, RiHome5Line } from '@remixicon/react';
import { Button } from '@/components/ui/wideset/button/Button';
import { NavigationBar } from '@/components/ui/wideset/navigation-bar/NavigationBar';
export default function NavigationBarDivider() {
return (
<div className="gap-ws-12 flex w-[40rem] flex-col">
<div className="rounded-ws-container-md border-ws-static-base bg-ws-static-foreground overflow-hidden border">
<NavigationBar>
<Pages current="Products" />
</NavigationBar>
<div className="px-ws-12 py-ws-9 flex items-center justify-between">
<p className="typography-subtitle-sm text-ws-static-strong">Products</p>
<Button size="sm">New product</Button>
</div>
</div>
<div className="rounded-ws-container-md border-ws-static-base bg-ws-static-foreground overflow-hidden border">
<NavigationBar divider={false}>
<Pages current="Dashboard" />
</NavigationBar>
<div className="gap-ws-3 px-ws-12 pb-ws-12 pt-ws-9 flex flex-col">
<p className="typography-title-sm text-ws-static-strong">Good morning, Adam</p>
<p className="typography-body-md text-ws-static-subtle">
Revenue is up 12% on last week.
</p>
</div>
</div>
</div>
);
}
function Pages({ current }: { current: string }) {
return (
<NavigationBar.Nav>
<NavigationBar.Item href="#" active={current === 'Dashboard'}>
<NavigationBar.Icon icon={RiHome5Line} />
<NavigationBar.Label>Dashboard</NavigationBar.Label>
</NavigationBar.Item>
<NavigationBar.Item href="#" active={current === 'Analytics'}>
<NavigationBar.Icon icon={RiBarChartLine} />
<NavigationBar.Label>Analytics</NavigationBar.Label>
</NavigationBar.Item>
<NavigationBar.Item href="#" active={current === 'Products'}>
<NavigationBar.Icon icon={RiBox3Line} />
<NavigationBar.Label>Products</NavigationBar.Label>
</NavigationBar.Item>
</NavigationBar.Nav>
);
}States
active marks the page the user is on: one link per bar, announced with aria-current="page". Anything after NavigationBar.Label, such as a Tag reading "New", is part of the link's name for screen readers. disabled dims a link, takes it out of the tab order and blocks it, for an area the user's plan does not include yet. Prefer hiding a page the user will never reach over showing it disabled.
import { RiBarChartLine, RiBox3Line, RiHome5Line, RiTaskLine } from '@remixicon/react';
import { NavigationBar } from '@/components/ui/wideset/navigation-bar/NavigationBar';
import { Tag } from '@/components/ui/wideset/tag/Tag';
export default function NavigationBarStates() {
return (
<div className="w-[40rem]">
<NavigationBar>
<NavigationBar.Nav>
<NavigationBar.Item href="#" active>
<NavigationBar.Icon icon={RiHome5Line} />
<NavigationBar.Label>Dashboard</NavigationBar.Label>
</NavigationBar.Item>
<NavigationBar.Item href="#">
<NavigationBar.Icon icon={RiBarChartLine} />
<NavigationBar.Label>Analytics</NavigationBar.Label>
</NavigationBar.Item>
<NavigationBar.Item href="#">
<NavigationBar.Icon icon={RiBox3Line} />
<NavigationBar.Label>Products</NavigationBar.Label>
<Tag size="sm">New</Tag>
</NavigationBar.Item>
<NavigationBar.Item href="#" disabled>
<NavigationBar.Icon icon={RiTaskLine} />
<NavigationBar.Label>Tasks</NavigationBar.Label>
</NavigationBar.Item>
</NavigationBar.Nav>
</NavigationBar>
</div>
);
}Navigation
Page links for a product with a handful of top-level areas. NavigationBar.Nav is a nav landmark that screen readers announce as "Main navigation", and active marks the page the user is on with aria-current="page". Keep it to about five links; a product with more areas needs a Sidebar. The end of the bar holds what applies on every page: a search field, a segmented control and the icon actions, which NavigationBar.Actions keeps close together.
import {
RiBarChartLine,
RiBox3Line,
RiHome5Line,
RiInbox2Line,
RiMenuLine,
RiMoonLine,
RiNotification3Line,
RiSearchLine,
RiSettings3Line,
RiSunFill,
RiTaskLine,
} from '@remixicon/react';
import { IconButton } from '@/components/ui/wideset/button/IconButton';
import { NavigationBar } from '@/components/ui/wideset/navigation-bar/NavigationBar';
import { SegmentedControl } from '@/components/ui/wideset/segmented-control/SegmentedControl';
import { TextInput } from '@/components/ui/wideset/text-input/TextInput';
const PAGES = [
{ label: 'Dashboard', icon: RiHome5Line },
{ label: 'Analytics', icon: RiBarChartLine },
{ label: 'Products', icon: RiBox3Line },
{ label: 'Tasks', icon: RiTaskLine },
];
const ACTIONS = [
{ label: 'Settings', icon: RiSettings3Line },
{ label: 'Inbox', icon: RiInbox2Line },
{ label: 'Notifications', icon: RiNotification3Line },
];
export default function NavigationBarNavigation() {
return (
<div className="w-[64rem]">
<NavigationBar>
<NavigationBar.Start>
<IconButton
variant="secondary"
preset="ghost"
size="sm"
icon={RiMenuLine}
aria-label="Open menu"
/>
<Logo />
</NavigationBar.Start>
<NavigationBar.Nav>
{PAGES.map(({ label, icon }) => (
<NavigationBar.Item key={label} href="#" active={label === 'Dashboard'}>
<NavigationBar.Icon icon={icon} />
<NavigationBar.Label>{label}</NavigationBar.Label>
</NavigationBar.Item>
))}
</NavigationBar.Nav>
<NavigationBar.End>
<TextInput size="sm" className="w-[10rem]">
<TextInput.Prefix inner>
<TextInput.Icon icon={RiSearchLine} />
</TextInput.Prefix>
<TextInput.Input type="search" placeholder="Search" aria-label="Search" />
</TextInput>
<SegmentedControl size="sm" defaultValue="light" aria-label="Theme">
<SegmentedControl.Item value="light" icon={RiSunFill} aria-label="Light" />
<SegmentedControl.Item value="dark" icon={RiMoonLine} aria-label="Dark" />
</SegmentedControl>
<NavigationBar.Actions>
{ACTIONS.map(({ label, icon }) => (
<IconButton
key={label}
variant="secondary"
preset="ghost"
size="sm"
icon={icon}
aria-label={label}
/>
))}
</NavigationBar.Actions>
</NavigationBar.End>
</NavigationBar>
</div>
);
}
/** Your logo goes here; this is the Wideset mark on its tile. */
function Logo() {
return (
<span className="bg-ws-static-alpha-strong text-ws-static-strong rounded-ws-control-lg size-ws-14 flex shrink-0 items-center justify-center">
<svg
viewBox="0 0 16 8"
role="img"
aria-label="Wideset"
className="h-ws-5 w-ws-9 fill-current"
>
<path d="M13.69 0s-2.07 5.32-2.15 5.52C11.5 5.42 9.18 0 9.18 0H7.09S4.78 5.52 4.74 5.59C4.7 5.52 2.24 0 2.24 0H0l3.74 8h2.06l2.35-5.66h.04c.02.06 2.39 5.66 2.39 5.66h2.12S15.98.07 16 0z" />
</svg>
</span>
);
}Breadcrumbs
On a page below the top level, the bar shows the path to it instead of the page links: put Breadcrumbs right after NavigationBar.Start. The last crumb is the current page, announced as such and not focusable; the others lead back up. Breadcrumbs is a nav landmark of its own, named "Breadcrumb", so the bar needs no NavigationBar.Nav here.
import {
RiBarChartFill,
RiInbox2Line,
RiMenuLine,
RiMoonLine,
RiNotification3Line,
RiSearchLine,
RiSettings3Line,
RiSunFill,
} from '@remixicon/react';
import { Breadcrumbs } from '@/components/ui/wideset/breadcrumbs/Breadcrumbs';
import { IconButton } from '@/components/ui/wideset/button/IconButton';
import { NavigationBar } from '@/components/ui/wideset/navigation-bar/NavigationBar';
import { SegmentedControl } from '@/components/ui/wideset/segmented-control/SegmentedControl';
import { TextInput } from '@/components/ui/wideset/text-input/TextInput';
const ACTIONS = [
{ label: 'Settings', icon: RiSettings3Line },
{ label: 'Inbox', icon: RiInbox2Line },
{ label: 'Notifications', icon: RiNotification3Line },
];
export default function NavigationBarBreadcrumbs() {
return (
<div className="w-[64rem]">
<NavigationBar>
<NavigationBar.Start>
<IconButton
variant="secondary"
preset="ghost"
size="sm"
icon={RiMenuLine}
aria-label="Open menu"
/>
<Logo />
</NavigationBar.Start>
<Breadcrumbs separator="arrow">
<Breadcrumbs.Item>
<RiBarChartFill className="size-ws-9" />
Analytics
</Breadcrumbs.Item>
<Breadcrumbs.Item>Report</Breadcrumbs.Item>
<Breadcrumbs.Item>Adam Smith January</Breadcrumbs.Item>
</Breadcrumbs>
<NavigationBar.End>
<TextInput size="sm" className="w-[10rem]">
<TextInput.Prefix inner>
<TextInput.Icon icon={RiSearchLine} />
</TextInput.Prefix>
<TextInput.Input type="search" placeholder="Search" aria-label="Search" />
</TextInput>
<SegmentedControl size="sm" defaultValue="light" aria-label="Theme">
<SegmentedControl.Item value="light" icon={RiSunFill} aria-label="Light" />
<SegmentedControl.Item value="dark" icon={RiMoonLine} aria-label="Dark" />
</SegmentedControl>
<NavigationBar.Actions>
{ACTIONS.map(({ label, icon }) => (
<IconButton
key={label}
variant="secondary"
preset="ghost"
size="sm"
icon={icon}
aria-label={label}
/>
))}
</NavigationBar.Actions>
</NavigationBar.End>
</NavigationBar>
</div>
);
}
/** Your logo goes here; this is the Wideset mark on its tile. */
function Logo() {
return (
<span className="bg-ws-static-alpha-strong text-ws-static-strong rounded-ws-control-lg size-ws-14 flex shrink-0 items-center justify-center">
<svg
viewBox="0 0 16 8"
role="img"
aria-label="Wideset"
className="h-ws-5 w-ws-9 fill-current"
>
<path d="M13.69 0s-2.07 5.32-2.15 5.52C11.5 5.42 9.18 0 9.18 0H7.09S4.78 5.52 4.74 5.59C4.7 5.52 2.24 0 2.24 0H0l3.74 8h2.06l2.35-5.66h.04c.02.06 2.39 5.66 2.39 5.66h2.12S15.98.07 16 0z" />
</svg>
</span>
);
}Minimal
Search, the segmented control and the menu button are optional, as they are in Figma: leave out what the product does not have. The menu button is for products whose links move into a Sidepanel on small screens; without one, the bar starts with the logo. Whatever it holds, the bar keeps its 64px height and its spacing.
import { RiBarChartLine, RiBox3Line, RiHome5Line, RiNotification3Line } from '@remixicon/react';
import { IconButton } from '@/components/ui/wideset/button/IconButton';
import { NavigationBar } from '@/components/ui/wideset/navigation-bar/NavigationBar';
export default function NavigationBarMinimal() {
return (
<div className="w-[40rem]">
<NavigationBar>
<NavigationBar.Start>
<Logo />
</NavigationBar.Start>
<NavigationBar.Nav>
<NavigationBar.Item href="#" active>
<NavigationBar.Icon icon={RiHome5Line} />
<NavigationBar.Label>Dashboard</NavigationBar.Label>
</NavigationBar.Item>
<NavigationBar.Item href="#">
<NavigationBar.Icon icon={RiBarChartLine} />
<NavigationBar.Label>Analytics</NavigationBar.Label>
</NavigationBar.Item>
<NavigationBar.Item href="#">
<NavigationBar.Icon icon={RiBox3Line} />
<NavigationBar.Label>Products</NavigationBar.Label>
</NavigationBar.Item>
</NavigationBar.Nav>
<NavigationBar.End>
<NavigationBar.Actions>
<IconButton
variant="secondary"
preset="ghost"
size="sm"
icon={RiNotification3Line}
aria-label="Notifications"
/>
</NavigationBar.Actions>
</NavigationBar.End>
</NavigationBar>
</div>
);
}
/** Your logo goes here; this is the Wideset mark on its tile. */
function Logo() {
return (
<span className="bg-ws-static-alpha-strong text-ws-static-strong rounded-ws-control-lg size-ws-14 flex shrink-0 items-center justify-center">
<svg
viewBox="0 0 16 8"
role="img"
aria-label="Wideset"
className="h-ws-5 w-ws-9 fill-current"
>
<path d="M13.69 0s-2.07 5.32-2.15 5.52C11.5 5.42 9.18 0 9.18 0H7.09S4.78 5.52 4.74 5.59C4.7 5.52 2.24 0 2.24 0H0l3.74 8h2.06l2.35-5.66h.04c.02.06 2.39 5.66 2.39 5.66h2.12S15.98.07 16 0z" />
</svg>
</span>
);
}API reference
NavigationBar
| Name | Description | Default |
|---|---|---|
divider | Draws the line along the bottom edge. Turn it off when the page under the bar opens with a large title, or when the bar sits on a grey canvas above content cards. boolean | true |
<element> is passed through to it. See MDN: global attributes.NavigationBar.Actions
<div> is passed through to it. See MDN: <div>.NavigationBar.End
<div> is passed through to it. See MDN: <div>.NavigationBar.Icon
| Name | Description | Default |
|---|---|---|
icon* | Icon component from `@remixicon/react`. RemixiconComponentType | — |
children | | — |
NavigationBar.Item
| Name | Description | Default |
|---|---|---|
active | Marks the link as the current page: active styling plus `aria-current="page"`. boolean | false |
asChild | Merges the link's props onto its only child instead of rendering an `<a>`, e.g. a react-router or Next.js `Link`. Renders the built-in `<a>`; use the `asChild` branch for a router `Link`. boolean | false |
children | The element to render as, e.g. `<Link to="/analytics" />`, holding the icon and the label. Required with `asChild`. `NavigationBar.Icon`, `NavigationBar.Label` and anything after the label, such as a `Tag`. ReactNode | ReactElement<unknown, string | JSXElementConstructor<any>> | — |
defaultMotion | Turns the component's built-in animations on or off. When omitted, inherits the value from the nearest `MotionProvider`. boolean | true |
disabled | Blocks navigation and dims the link via `aria-disabled`; the link leaves the tab order and loses its `href`. With `asChild`, clicks never reach the child, so its `onClick` and a router `Link`'s navigation do not run. boolean | false |
<a> is passed through to it. See MDN: <a>.NavigationBar.Label
<span> is passed through to it. See MDN: <span>.NavigationBar.Nav
| Name | Description | Default |
|---|---|---|
aria-label | Defines a string value that labels the current element. Names the landmark for screen readers, which add "navigation" themselves. Change it when the page has another `nav` with the same name, such as a `Sidebar`. string | 'Main' |
<element> is passed through to it. See MDN: global attributes.NavigationBar.Start
<div> is passed through to it. See MDN: <div>.Accessibility
- At the top of the page the root
headeris the banner landmark: one bar per page. NavigationBar.Navis anavnamed “Main”. With aSidebaron the same page, give eachnavits own name.activesetsaria-current="page", so the current page is announced.NavigationBar.Iconis hidden from screen readers; the label names the link, and aTagafter it becomes part of that name.- The menu button, the icon actions and an icon-only segmented control need an
aria-label.
| Part | Renders | Description |
|---|---|---|
| NavigationBarRenders no element | <element> | The app's top bar: menu button and logo, page links or breadcrumbs, tools at the end. |
| NavigationBar.ActionsRenders no element | <div> | A tight row of icon buttons, usually the last thing in `NavigationBar.End`. |
| NavigationBar.EndRenders no element | <div> | The trailing group, pushed to the end of the bar: search, segmented control, actions. |
| NavigationBar.IconRenders no element | — | The leading icon of a `NavigationBar.Item`; it follows the item's state. |
| NavigationBar.ItemRenders no element | <a> | A page link in `NavigationBar.Nav`. Renders an `<a>`; with `asChild` it renders its only child instead, such as a router `Link`, which then holds the parts. |
| NavigationBar.LabelRenders no element | <span> | The page name of a `NavigationBar.Item`; it truncates when the bar runs out of room. |
| NavigationBar.NavRenders no element | <element> | The page links, rendered as a `nav` landmark. |
| NavigationBar.StartRenders no element | <div> | The leading group: menu button, logo and product name. |
import { RiBarChartLine, RiBox3Line, RiHome5Line, RiMenuLine, RiNotification3Line, RiSettings3Line } from '@remixicon/react';
import { IconButton } from '@/components/ui/wideset/button/IconButton';
import { NavigationBar } from '@/components/ui/wideset/navigation-bar/NavigationBar';
<div className="w-[40rem] max-w-full">
<NavigationBar>
<NavigationBar.Start>
<IconButton
variant="secondary"
preset="ghost"
size="sm"
icon={RiMenuLine}
aria-label="Open menu"
/>
<Logo />
</NavigationBar.Start>
<NavigationBar.Nav>
<NavigationBar.Item href="#" active>
<NavigationBar.Icon icon={RiHome5Line} />
<NavigationBar.Label>Dashboard</NavigationBar.Label>
</NavigationBar.Item>
<NavigationBar.Item href="#">
<NavigationBar.Icon icon={RiBarChartLine} />
<NavigationBar.Label>Analytics</NavigationBar.Label>
</NavigationBar.Item>
<NavigationBar.Item href="#">
<NavigationBar.Icon icon={RiBox3Line} />
<NavigationBar.Label>Products</NavigationBar.Label>
</NavigationBar.Item>
</NavigationBar.Nav>
<NavigationBar.End>
<NavigationBar.Actions>
<IconButton
variant="secondary"
preset="ghost"
size="sm"
icon={RiSettings3Line}
aria-label="Settings"
/>
<IconButton
variant="secondary"
preset="ghost"
size="sm"
icon={RiNotification3Line}
aria-label="Notifications"
/>
</NavigationBar.Actions>
</NavigationBar.End>
</NavigationBar>
</div>
);
}
/** Your logo goes here; this is the Wideset mark on its tile. */
function Logo() {
return (
<span className="bg-ws-static-alpha-strong text-ws-static-strong rounded-ws-control-lg size-ws-14 flex shrink-0 items-center justify-center">
<svg
viewBox="0 0 16 8"
role="img"
aria-label="Wideset"
className="h-ws-5 w-ws-9 fill-current"
>
<path d="M13.69 0s-2.07 5.32-2.15 5.52C11.5 5.42 9.18 0 9.18 0H7.09S4.78 5.52 4.74 5.59C4.7 5.52 2.24 0 2.24 0H0l3.74 8h2.06l2.35-5.66h.04c.02.06 2.39 5.66 2.39 5.66h2.12S15.98.07 16 0z" />
</svg>
</span>