Direction sphere
A direction input shaped like what it controls. Drag a light across a sphere and a sample beside it takes the highlight and drop shadow of that light. Two sliders carry the same two numbers, so the sphere is a convenience and never the only way in.
315° azimuth 48° elevation
When to use
- Light and shadow direction in a design tool, an emboss or a drop-shadow editor.
- Any value that is two angles, such as azimuth and elevation.
When not to use
- A single angle; use a dial or a slider.
- Exact placement of a point on a plane; use two number fields.
Installation
pnpm dlx shadcn@latest add @caliper/direction-sphere
Adds its 6 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
DirectionSphere
12 props
Keyboard
- ←
- Moves to the previous item or value.
- →
- Moves to the next item or value.
- ↑
- Moves to the previous item or value.
- ↓
- Moves to the next item or value.
Accessibility
It exposes group semantics, with aria-roledescription, aria-label, aria-live and aria-valuetext kept in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/direction-sphere.mdThe index of every part is at /llms.txt.