Site Navbar
A site header: brand with a small tag, links that dim until hovered, a thin marker that slides under the current link, dropdowns that drop in on hover, two buttons, and a folding menu on narrow widths.
pixikit.com/docs/components/site-navbar
Customize
Height64px
Position
Nav align
Background color
Blur0px
Border color
Text color
Inactive opacity0.50
Font size16.0px
Item padding x20px
Marker height2.0px
Marker color
Duration0.30s
Dropdown trigger
Dropdown width150px
Dropdown radius20px
Close delay0.15s
Mobile breakpoint720px
Props
33| Name | Type | Default | Description |
|---|---|---|---|
brand | string | "Northwind" | Brand name at the left. |
brandHref | string | "#" | Where the brand links to. |
badge | string | "Beta" | Small tag beside the brand. Leave empty for none. |
items | SiteNavbarItem[] | SAMPLE | The links. A sample set shows when left out. |
active | string | None | Label of the current page, when you hold it. |
defaultActive | string | None | Label of the current page at first. |
onNavigate | (label: string) => void | None | Called with the label of a clicked link. |
primaryLabel | string | "Join us" | Text of the filled button at the right. Leave empty for none. |
primaryHref | string | "#join" | |
secondaryLabel | string | "Sign in" | Text of the outlined button at the right. Leave empty for none. |
secondaryHref | string | "#sign-in" | |
actions | ReactNode | None | Your own buttons at the right; replaces the two built-in ones. |
height | number | 64 | Bar height, in px. |
position | "static" | "sticky" | "fixed" | "sticky" | How the bar is placed in the page. |
navAlign | "start" | "center" | "end" | "start" | Where the links sit between the brand and the buttons. |
backgroundColor | string | "var(--background)" | Bar fill. |
blur | number | 0 | Blur of the page under the bar, in px. Needs a see-through fill. |
borderColor | string | "var(--border)" | Colour of the hairline under the bar and of the outlines. |
textColor | string | "var(--foreground)" | Text colour. |
inactiveOpacity | number | 0.5 | Opacity of links that are not current or hovered. |
fontSize | number | 16 | Link size, in px. |
itemPaddingX | number | 20 | Space left and right of each link, in px. |
markerHeight | number | 2 | Thickness of the marker under the current link, in px. |
markerColor | string | "var(--foreground)" | Marker colour. |
duration | number | 0.3 | Seconds the marker takes to slide. |
dropdownTrigger | "hover" | "click" | "hover" | What opens a dropdown. Click and the keyboard always work. |
dropdownWidth | number | 150 | Dropdown width, in px. |
dropdownRadius | number | 20 | Dropdown corner radius, in px. |
closeDelay | number | 0.15 | Seconds a dropdown waits before closing after the pointer leaves. |
mobileBreakpoint | number | 720 | Bar width under which the links fold into a menu button, in px. |
menuLabel | string | "Menu" | Screen reader text of the menu button. |
className | string | "" | |
style | CSSProperties | None |