Site footer
A website footer with link columns and newsletter, a minimal layout, and a large fading Silicon UI mark.
A sticky website header that turns solid on scroll, with a gliding active link, mega menu panels, and a mobile sheet.
npx shadcn@latest add @silicon-ui/site-headernpx shadcn@latest add @silicon-ui/site-headerInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/blocks/site-header/site-header.tsxcomponents/silicon-ui/blocks/site-header/site-header.module.csscomponents/silicon-ui/lib/media.ts sharedcomponents/silicon-ui/segmented-control/segmented-control.tsx sharedcomponents/silicon-ui/segmented-control/segmented-control.module.css sharedInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
SiteHeader| Prop | Type | Default |
|---|---|---|
variant`simple` puts links beside the brand, `centered` centers them in a quiet capsule, `mega` opens panels for items with links. | SiteHeaderVariant
| "mega" |
brand | { name: string; href?: string; mark?: ReactNode } | { name: "Silicon" } |
items | SiteHeaderItem[] | siteHeaderExampleItems |
currentValue of the item that holds the current page (controlled). | string | — |
defaultCurrentInitial current item when uncontrolled. | string | — |
onCurrentChangeCalled when a destination inside an item is chosen, with that item's value. | (value: string) => void | — |
onNavigateCalled for every destination: items, panel links, the brand, and actions with an href. | (destination: SiteHeaderDestination) => void | — |
secondaryActionA quiet action before the primary one, such as Sign in. Pass null to hide it. | SiteHeaderAction | null | { label: "Sign in" } |
primaryActionThe one primary action at the end of the bar. Pass null to hide it. | SiteHeaderAction | null | { label: "Get Silicon" } |
stickySticks to the top of its scroll container. Defaults to true. | boolean | true |
scrollContainerThe element that scrolls, when it is not the window. The header turns solid once it scrolls. | RefObject<HTMLElement | null> | — |
scrollThresholdPixels of scroll before the background turns solid. Defaults to 8. | number | 8 |
labelAccessible name of the navigation landmark. | string | "Main" |
className | string | — |
Also accepts the props of HTMLAttributes.
SiliconMark| Prop | Type | Default |
|---|---|---|
className | string | — |
SiteHeaderBlock| Prop | Type | Default |
|---|---|---|
variant | SiteHeaderVariant
| "mega" |