Sections
All-AccessNewFruit-wall nursery header: nav items are spurs of one espalier, the sun is the cursor
Use Cordon as the site header of a calm, crafted brand: up to five nav items (one of them with a submenu), a basket and one primary action.
pnpm dlx shadcn@latest add @motionkit-pro/cordonnpx shadcn@latest add @motionkit-pro/cordonyarn dlx shadcn@latest add @motionkit-pro/cordonbunx --bun shadcn@latest add @motionkit-pro/cordonRequires an All-Access or Signature license and the @motionkit-pro registry with your token. See Installation.
The files land in components/sections/.
import { Cordon } from "@/components/sections/cordon"
export default function Header({ pathname }: { pathname: string }) {
return (
<Cordon
active={pathname}
content={{
brand: { name: "Acme", note: "Garden tools", href: "/" },
items: [
{
label: "Shop",
href: "/shop",
children: [
{ label: "Pruners", href: "/shop/pruners", note: "12" },
{ label: "Ties", href: "/shop/ties" },
],
},
{ label: "Journal", href: "/journal" },
{ label: "About", href: "/about" },
],
cta: { label: "Book a visit", href: "/visit", note: "Saturdays" },
}}
crate={{ count: 1, href: "/cart" }}
/>
)
}Every text sits in one typed content prop; each key you pass replaces the default copy (a
fruit-wall nursery), so pass at least brand and items.
| Key | Type | Notes |
|---|---|---|
brand | { name, note?, href } | Wordmark over the trunk. |
items | { label, href, children?: { label, href, note? }[] }[] | Spurs of the arm; an item with children opens a second tier. |
cta | { label, href, note? } | The terracotta pot; undefined hides it. |
navLabel | string | Accessible name of the navigation. |
skipLabel | string | Skip link (targets skipTo, default #main). |
menuLabel | string | Drawer button and drawer title on phones. |
closeLabel | string | Drawer close button. |
crateLabel | (count: number) => string | Accessible name of the basket link. |
active (the current href, which bears the fruit), crate ({ count, href }), onNavigate
(for client-side routing) and fonts are props of their own.
None: the tree is drawn, so there is nothing to supply.
espalier (default): fruit on the current spur. Preview it with ?demo=default.blossom: a flower and buds instead (spring). Preview it with ?demo=blossom.stepover: a knee-high cordon at the bottom of the screen. Preview it with ?demo=stepover.Prop
Type
Every colour is a prop and takes any CSS colour: hex, RGB, HSL or OKLCH. wall is the bar,
ink the text, bark, leaf, fruit, blush and flower the tree, shadow the tint of every
cast shadow (never black), raffia the ties and the focus tie, pot and potInk the action.
Lighter and darker tones of leaf and bark are derived from them.
<Cordon
colors={{
wall: "#f5f0e6",
ink: "#3a2c1e",
bark: "#5b4532",
leaf: "#3f7a4a",
fruit: "#d9d46a",
blush: "#c4562e",
shadow: "#3d5a91",
pot: "#b04a2a",
potInk: "#fbf6ee",
}}
/>use-prefers-reduced-motion, fx-runtime.nav, aria-current="page" on the active item, and submenus as
disclosure buttons; the phone drawer is a modal dialog with a title and a close button.Below 900 px the bar keeps the bare arm, the brand, the basket and a menu button; the drawer shows the tree upright, one tier per item. On touch screens the sun crosses the bar once every 40 s; vertical scroll is never blocked.
Leaves stay still facing the default sun; opening a submenu shows the second tier without motion.
pnpm size).Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Not measured yet · budget 16.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, @radix-ui/react-dialog.
—
Leaves stay still facing the default sun; opening a submenu shows the second tier without motion.
No keyboard interaction of its own.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)