Sun path
A day's sun drawn on its arc, with a slider to move through the day. The sky changes colour with the sun's height, and after sunset a moon takes the same arc as stars come out.
Sun is up
12:30
When to use
- Weather, travel, photography and solar-energy pages.
- Anywhere the time of day shapes a decision.
When not to use
- Exact positions in the sky; it is an illustration of the day's shape.
- Polar days and nights with no sunrise.
Installation
pnpm dlx shadcn@latest add @caliper/sun-path
Adds its 3 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
SunPath
4 props
Also accepts the native props of its root element and a ref.
bodyAt
0 props
No props of its own; it accepts the native props of its root element.
toMinutes
0 props
No props of its own; it accepts the native props of its root element.
formatClock
0 props
No props of its own; it accepts the native props of its root element.
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes group semantics, with aria-hidden, aria-label and aria-valuetext kept in step with state.
Motion
- State changes animate with the library's shared durations and curves, so its timing matches every other part.
- Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/sun-path.mdThe index of every part is at /llms.txt.