SiteHeader
The top of a landing or a product page: the brand, a few links, the language and one call to action. On phones the links fold into a menu that works without JavaScript.
import { SiteHeader } from '@sypnia/ui/react'
A product's header
Code
import { Button, SiteHeader } from '@sypnia/ui/react';
// Narrow the window: on phones the links fold into the menu.
export default function Header() {
return (
<SiteHeader product="Data" homeHref="#"
links={[{ label: 'Product', href: '#product' }, { label: 'Pricing', href: '#pricing', current: true }, { label: 'Docs', href: '#docs' }]}
language={{ label: 'Español', href: '#es', lang: 'es' }}
action={<Button variant="primary" size="sm" href="#start">Start</Button>} />
);
} When to use it
Use it when
- Landings, product pages, pricing, the blog.
Do not use it when
- Documentation: that is DocsHeader.
- A signed-in console: that is AppShell.
For everyone
- The links are a named navigation; the current page is marked.
- The menu is a native disclosure: Enter and Space open it.
Props
| SiteHeader | Type | Default |
|---|---|---|
linksrequired | SiteLink[] | |
actionThe one call to action, at the end. | ReactNode | |
brandInstead of the Sypnia logo. | ReactNode | |
homeHrefWhere the brand leads. | string | / |
labelName of the navigation for screen readers. | string | |
languageThe same page in the other language. | { label: string; href: string; lang: string; } | |
productThe product, beside the logo («Data»). | string | |
surfacefalse: no night-or-paper button (a page with one surface only). | boolean | true |