Navigation
Site header
The top of every front: brand, context, navigation, actions, and a menu on a phone.
Keystone
North Star Games
Installation
pnpm add @elsikora/keystone-ui-kitUsage
import { SiteHeader } from "@elsikora/keystone-ui-kit";import { Button, ModeToggle, SiteHeader, siteHeaderLinkClasses } from "@elsikora/keystone-ui-kit";
export default function SiteHeaderDefaultExample() { return ( <SiteHeader brand={ <a href="#site-header" className="font-display text-xl font-bold"> Keystone </a> } context="North Star Games" nav={ <> <a href="#releases" className={siteHeaderLinkClasses.navCurrent}> Releases </a> <a href="#operators" className={siteHeaderLinkClasses.nav}> Operators </a> </> } actions={ <> <ModeToggle /> <Button variant="outline" size="sm"> Sign out </Button> </> } menu={ <ul className="frame py-4"> <li> <a href="#releases" className={siteHeaderLinkClasses.menuCurrent}> Releases </a> </li> <li> <a href="#operators" className={siteHeaderLinkClasses.menu}> Operators </a> </li> </ul> } /> );}Examples
Default
Keystone
North Star Games
API reference
SiteHeader
| Prop | Type | Default | Description |
|---|---|---|---|
brand | ReactNode | - | The mark and name, as a link home. |
context | ReactNode | - | Where the reader is: a studio, a role. |
nav | ReactNode | - | The large screen's navigation. |
actions | ReactNode | - | The front's actions. |
menu | ReactNode | - | The phone menu; with it the header has a menu button. |
menuLabels | { open: string; close: string } | - | The menu button's words. |
navLabel | string | "Main" | Both navigations' name. |
closeMenuOn | unknown | - | A value whose change closes the menu (the path). |
sticky | boolean | false | Stays at the top as the page scrolls. |
Notes
- Mark the current link with aria-current; the router's active link does it.