# Navbar

> A horizontal top-of-page bar with a brand mark, navigation links, and actions on the right.

- Package: `fancy-ui-react` (React 18/19 + Tailwind CSS v4)
- Category: Navigation
- Tags: nav, header, top-bar, links, sticky
- Types: `NavbarProps`, `NavbarLinkProps`
- Docs: https://fancy-ui.rama.app/docs/components/navbar
- Source: https://github.com/RamaHerbin/fancy-ui/tree/main/react/src/components/navbar

## Import

```tsx
import { Navbar } from 'fancy-ui-react';
```

Setup (once per project): `npm install fancy-ui-react`, then put these lines in your main CSS file (the stylesheet import goes right after `@import "tailwindcss";`):

```css
@import "tailwindcss";
@import "fancy-ui-react/tailwind.css";
```

and import the component styles once in the app entry: `import "fancy-ui-react/styles.css";`. Full guide: https://fancy-ui.rama.app/llms.txt

The names below are the ones to write in React; when one differs from the Svelte name, the Svelte name follows in parentheses. `class` becomes `className`, a callback takes the name the React port declares (`onclick` becomes `onClick`), snippets become `ReactNode` props (render functions when they take arguments) and the default snippet is `children`. Divergences: https://github.com/RamaHerbin/fancy-ui/tree/main/react#divergences-from-the-svelte-api

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | `"Main"` | Accessible name for the nav landmark. |
| `sticky` | `boolean` | `false` | Pins the bar to the top with `position: sticky` and a translucent, blurred background. |
| `bordered` | `boolean` | `true` | Draws a 1px hairline along the bottom edge. |
| `className` (Svelte `class`) | `string` | — | Additional CSS classes, merged onto the root. |
| `ref` | `HTMLElement \| null` | `null` | Bindable reference to the root nav element. |
| `NavbarLink.href` (required) | `string` | — | Destination URL. |
| `NavbarLink.current` | `boolean` | `false` | Marks this as the current page — aria-current="page" plus a visible weight/colour change. |
| `NavbarLink.external` | `boolean` | `false` | Opens in a new tab with a safe rel, and notes it for assistive tech. |
| `NavbarLink.disabled` | `boolean` | `false` | Strips the link out of the click and keyboard-activation paths. |
| `NavbarLink.onClick` (Svelte `NavbarLink.onclick`) | `(event: MouseEvent) => void` | — | Native click handler. Never called while disabled. |
| `NavbarLink.className` (Svelte `NavbarLink.class`) | `string` | — | Additional CSS classes, merged onto the anchor. |
| `NavbarLink.ref` | `HTMLAnchorElement \| null` | `null` | Bindable reference to the anchor element. |
| `NavbarLink.sound` | `boolean` | `false` | Plays select when a navbar link that is not already current is activated, once the user has enabled sound |

## Node props

| Prop | Description |
| --- | --- |
| `brand` | The brand mark / wordmark, on the left. |
| `children` | The navigation links, between the brand and the actions. |
| `actions` | Actions on the right — search, sign-in, a theme switch. |
| `NavbarLink.children` | The link's label. |

## Example

No React example is published for this component yet: start from the import above and the props table. The full examples are Svelte-only, on https://fancy-ui.rama.app/docs/components/navbar.md.
