Sections
All-AccessNewNight-train header drawn as the station's coach-order board: coaches are the nav, the hand opens doors
Use it as the site header of a travel, booking or logistics product with four to six sections. Each nav item is a coach; items with sub-pages open a reservation chart under their coach.
pnpm dlx shadcn@latest add @motionkit-pro/consistnpx shadcn@latest add @motionkit-pro/consistyarn dlx shadcn@latest add @motionkit-pro/consistbunx --bun shadcn@latest add @motionkit-pro/consistRequires an All-Access or Signature license and the @motionkit-pro registry with your token. See Installation.
The files land in components/sections/.
import { Consist } from "@/components/sections/consist"
export default function Header({ pathname }: { pathname: string }) {
return (
<Consist
active={pathname}
content={{
brand: { name: "Northline", href: "/", engine: "NL 01" },
items: [
{ label: "Seats", href: "/seats", kind: "seats", number: "1", cls: "2" },
{ label: "Sleepers", href: "/sleepers", kind: "sleeper", number: "2", cls: "1" },
{ label: "Dining", href: "/dining", kind: "dining", number: "3" },
],
cta: { label: "Book", href: "/book", route: "Oslo — Bergen" },
train: { service: "R 7", departs: "Oslo 22:10", arrives: "Bergen 07:05" },
}}
/>
)
}Every text sits in one typed content prop; each key you pass replaces the default copy (a night
train from Ankara to Kars).
| Key | Type | Notes |
|---|---|---|
brand | { name, href, engine? } | The locomotive; engine is its number on the board. |
items | ConsistItem[] | One coach each. |
cta | ConsistCta | Route plate on the van: { label, href, route?, note?, noteHead? }. |
train | ConsistTrain | { service?, platform?, destination?, departs?, arrives? } on the board. |
sectors | string[] | Overhead sector letters. |
skipLabel | string | Skip link text (target: the skipTo prop). |
navLabel | string | Accessible name of the navigation. |
menuLabel | string | Tail lamp button on small screens. |
closeLabel | string | Close button of the board on small screens. |
boardTitle | ReactNode | Heading of the board on small screens. |
coachWord | string | Before the coach number on a chart ("VAGON"). |
planLabel | (coach) => string | Accessible name of a reservation chart. |
An item is { label, href, kind, local?, number?, cls?, children?, plan? }. kind (seats,
couchette, sleeper, dining, bikes) picks the windows; local is the name printed on the
band in lang. With children and plan: { compartments, berths, firstBerth, title? } the coach
opens a chart whose sub-links light their compartments.
None: the train is drawn, so there is nothing to supply.
night (default): blue livery, amber windows. Preview it with ?demo=default.day: cream livery for light pages. Preview it with ?demo=day.diagram: the printed poster, one line, no fills. Preview it with ?demo=diagram.Prop
Type
Every colour is a prop and takes any CSS colour: hex, RGB, HSL or OKLCH. Each variant has its own
palette (CONSIST_DEFAULT_COLORS); colors overrides any key of it. Lettering on the coaches picks
cream or ink from the lightness of livery.
<Consist
colors={{
board: "#141a2e",
livery: "#23336b",
band: "#4d93a8",
window: "#182040",
lamp: "#f2be55",
accent: "#e2452c",
cream: "#f5efdf",
ink: "#161c33",
safety: "#f3cf3c",
steel: "#9aa1ab",
paper: "#f6f0e1",
}}
/>use-prefers-reduced-motion, fx-runtime.nav of links with aria-current="page", a skip link, and coaches with sub-pages as
disclosure buttons; Escape closes a chart and arrows move through its links.aria-hidden.stack: below the wide layout the board keeps the locomotive, the current coach and the tail
lamps, which open the whole board turned upright in a dialog. A passenger walks the platform on
touch; vertical scroll is never blocked.
The train stands at the platform from the first frame: no arrival run, doors and lamps change state without sliding.
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.
—
The train stands at the platform from the first frame; doors and lamps change state without sliding.
No keyboard interaction of its own.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)