Site header
A site header: brand, navigation and actions. On phones the links move into the kit's full-screen menu (cells dissolve, labels roll).
demos/site-header.tsx
import { SiteHeader } from "pixelbits/blocks/site-header";
import { Button } from "pixelbits/button";
export default function Demo() {
return (
<div className="w-full overflow-hidden rounded-pb-md border border-pb-border">
<SiteHeader
sticky={false}
className="border-b-0"
brand={
<a href="#home" className="text-sm font-medium">
pixel<span className="font-light">bits</span>
</a>
}
links={[
{ label: "Work", href: "#work", current: true },
{ label: "Studio", href: "#studio" },
{ label: "Journal", href: "#journal" },
]}
actions={
<Button size="sm" variant="primary">
Contact
</Button>
}
menuFooter="hello@pixelbits.dev"
/>
</div>
);
}Installation
npm: import
import { SiteHeader } from "pixelbits/site-header";shadcn: copy the source
npx shadcn add https://pixelbits.ali-moradi-develop.com/r/block-site-header.jsonAPI
<SiteHeader>
A site header: brand, navigation and actions. On phones the links move into the kit's full-screen menu (cells dissolve, labels roll).
Example
<SiteHeader brand={<a href="/"><Logo /></a>} links={[{ label: "Work", href: "/work" }]} actions={<Button size="sm">Contact</Button>} />| Prop | Type | Default | Description |
|---|---|---|---|
| brand* | ReactNode | — | The logo or site name, linked to the home page by you. |
| links* | MenuLink[] | — | Main navigation. On phones it moves into a full-screen menu. |
| actions | ReactNode | — | Content at the end: a call to action, a theme switch, a search button. |
| sticky | boolean | true | Stick to the top while scrolling, with a translucent background. |
| menuFooter | ReactNode | — | Content under the links in the phone menu (contact, social). |
Also accepts every prop of HTMLAttributes<HTMLElement>.