Skip to content

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'

On this page
  1. A product's header
  2. When to use it
  3. For everyone
  4. Props

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

SiteHeaderTypeDefault
linksrequired SiteLink[]
action

The one call to action, at the end.

ReactNode
brand

Instead of the Sypnia logo.

ReactNode
homeHref

Where the brand leads.

string /
label

Name of the navigation for screen readers.

string
language

The same page in the other language.

{ label: string; href: string; lang: string; }
product

The product, beside the logo («Data»).

string
surface

false: no night-or-paper button (a page with one surface only).

boolean true
  1. A product&#39;s header
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms