Skip to content

Navigation

Site header

The top of every front: brand, context, navigation, actions, and a menu on a phone.

Installation

Terminal
pnpm add @elsikora/keystone-ui-kit

Usage

Import
import { SiteHeader } from "@elsikora/keystone-ui-kit";
docs/site-header/default.example.tsx
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

API reference

SiteHeader

PropTypeDefaultDescription
brandReactNode-The mark and name, as a link home.
contextReactNode-Where the reader is: a studio, a role.
navReactNode-The large screen's navigation.
actionsReactNode-The front's actions.
menuReactNode-The phone menu; with it the header has a menu button.
menuLabels{ open: string; close: string }-The menu button's words.
navLabelstring"Main"Both navigations' name.
closeMenuOnunknown-A value whose change closes the menu (the path).
stickybooleanfalseStays at the top as the page scrolls.

Notes

  • Mark the current link with aria-current; the router's active link does it.