Sections
FreeNewCanvasObservatory booking on a card star wheel: the disc is the date picker, the oval window is the night you book
Use it as the booking form of an observatory, a dark-sky lodge or a night tour: a card planisphere whose disc is the date picker, the oval window the night that is booked.
pnpm dlx shadcn@latest add @motionkit/planispherenpx shadcn@latest add @motionkit/planisphereyarn dlx shadcn@latest add @motionkit/planispherebunx --bun shadcn@latest add @motionkit/planisphereRequires the @motionkit namespace in components.json. See Installation.
The files land in components/sections/.
import { Planisphere } from "@/components/sections/planisphere"
export default function Page() {
return (
<Planisphere
latitude={51.5}
longitude={-0.1}
utcOffset={0}
closedWeekdays={[1]}
placesLeft={(iso) => seatsFor(iso)}
content={{
brand: "Ridge Observatory",
brandLine: "Star wheel for latitude 51° 30′ N",
makersLine: "Face south and hold it overhead",
makersLineRight: "For latitude 51° 30′ N",
sessions: [{ id: "late", label: "Late", time: "22:00" }],
referencePrefix: "RO",
}}
onSubmit={async (booking) => (await book(booking)).reference}
/>
)
}The window is cut for latitude and the sky is computed from the real star positions, Moon phase and
sidereal time; today (ISO) fixes the first bookable night, otherwise the real date is read after
mount. Configuration (capacity, maxGuests, prices, moonDays, bookableDays,
midnightTemps, formatPrice) stays in props. Fonts come from --ps-display, --ps-sans and
--ps-mono.
sleeve (default): buff sleeve over an indigo chart. Preview it with ?demo=default.day-print: the reverse print, indigo sleeve over a cream chart with indigo stars. Preview it
with ?demo=day-print.slot: a horizontal die-cut slot over a one-column form. Preview it with ?demo=slot.Every text, button names included, lives in one typed content prop; keys you leave out keep the demo copy shown above.
<Planisphere content={{ title: "Your title" }} />| Key | Type | Notes |
|---|---|---|
brand, brandLine, title, lede | string / ReactNode | Printed on the sleeve. |
makersLine, makersLineRight | string | Printed round the window. |
sessions | { id, label, time }[] | Sessions of a night; time is the local clock, "22:30". |
referencePrefix | string | Start of the made-up reference when onSubmit returns none. |
night, session, guests, name, email, note, notePlaceholder | string | Field labels. |
upTonight, darkNight, moonNight, perGuest, placesLeft | string / (left, capacity) => string | Night summary. |
closed, fullMoon, soldOut, outOfRange, nameShort, emailBad, tooMany | string / function | Why a night or a field is refused. |
stamp, pending, failed, reassurance, held, undo | string / function | The hold stamp and its result. |
prev, next, earlier, later, turnWheel | string | Step buttons and the wheel's accessible name. |
Prop
Type
Every colour is a prop and takes any CSS colour: hex, RGB, HSL or OKLCH.
<Planisphere
colors={{
sleeve: "#d2ecfc",
ochre: "#1ebde3",
index: "#00a189",
night: "#421900",
milky: "#764834",
ink: "#25170c",
paper: "#ddf2ff",
pencil: "#007c64",
brass: "#50b1dc",
}}
/>use-prefers-reduced-motion, fx-runtime, section-runtime.stack: columns stack, text first. Vertical scroll is never blocked.
The star wheel rests on the chosen night with the sky drawn in full; turning it to another night jumps there without the spin, and the stamp lands 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 22.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom.
—
The star wheel rests on the chosen night with the sky drawn in full; turning it to another night jumps there without the spin, and the stamp lands without motion.
No keyboard interaction of its own.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)