crucıble

Meridian

A day/night theme switch built as a miniature diorama: the sun sets and the moon rises along a shallow arc, the sky crossfades through dusk, clouds drift out, and stars ignite staggered once the moon seats. A real role=switch with keyboard toggle; controlled or uncontrolled.

motionfree

Installation

CLI

npx shadcn@latest add @crucible/meridian

Manual — install dependencies, then copy the source

npm install motion

Props

PropTypeDefaultDescription
checkedbooleanControlled night state — true is night/dark.
defaultCheckedbooleanfalseInitial night state when uncontrolled.
onChange(checked: boolean) => voidFires on every toggle with the next night state.
scalenumber1Size multiplier applied to the whole diorama.
durationnumber0.6Seconds the arc + scene transition takes (spring visual duration).
starCountnumber7Stars that ignite, staggered, once the moon seats.
cloudCountnumber3Clouds that drift in the day sky.
dayColorsPartial<MeridianPalette>Day palette overrides — warm sun on blue sky.
nightColorsPartial<MeridianPalette>Night palette overrides — cool moon on indigo sky.
labelstring"Toggle dark mode"Accessible label for the switch.
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"button">, "onChange">they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, and passes className through.