Add the Nook "Navbar" component to this project, exactly as Nook ships it.
The bar at the top of a site or app. Links fold behind a menu button when it is narrow.
Steps
1. Check for `nook.json` in the project root. If it is missing, run `npx nook-ui@latest init` first (React or Next.js with Tailwind CSS v4). It adds the Nook tokens, the theme and `cn()`.
2. Run `npx nook-ui@latest add navbar`. It writes `components/ui/navbar.tsx` together with everything the component needs. Do not write the component from memory.
3. If you cannot run commands, fetch http://localhost:3000/r/navbar.json, write every entry of `files` to the path it names, install the packages in `dependencies`, and repeat for each name in `registryDependencies`.
4. Use it where I ask. Start from this example:
```tsx
import { Button } from "@/components/ui/button";
import { Navbar, NavbarActions, NavbarBrand, NavbarLink, NavbarNav, NavbarToggle } from "@/components/ui/navbar";
export default function NavbarDefault() {
return (
Nook
ProductPricingDocsChangelog
);
}
```
API
- `Navbar`: The bar. It responds to its own width, not the screen.
- `NavbarBrand, NavbarNav, NavbarActions, NavbarToggle`: The logo, the links, the buttons at the end and the menu button.
- `NavbarMenu`: A link that opens a list of more links. Keyboard: Enter or arrow down opens it, arrows move, Escape closes.
- `label` (`ReactNode`): The text on the button.
- `NavbarMenuLink`: One link inside a menu, with a title, a line of description and an icon.
- `title` (`ReactNode`): The link text.
- `description` (`ReactNode`): What is behind it.
- `icon` (`ReactNode`): An icon before the text.
- `NavbarLink`: One link.
- `active` (`boolean`): Marks the link for the page being viewed.
- `render` (`ReactElement`): Render your router's link instead.
Rules
- Colors, radii, shadows and motion come from Nook tokens and classes such as `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg` and `h-control`. Never hard-code them.
- Do not restyle or simplify the file. Change how it looks through `className`, its props and the theme.
- It must keep working with the keyboard, in light and dark mode, and in the sharp, soft and bold styles.
- Accessibility: A header holding a named navigation. The menu button reports `aria-expanded` and is only shown while the links are folded. The current page is marked with `aria-current`.
Done when the component renders like the example in light and dark mode and the project type-checks.