Skip to content
caliper ui pro docs

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.

Pro

315° azimuth 48° elevation

Raised

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

terminal
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
PropTypeDefaultDescription
labelstring"Light direction"
azimuthnumber—Controlled when set.
defaultAzimuthnumber315
elevationnumber—Controlled when set.
defaultElevationnumber48
onChange((value: LightDirection) => void)—
previewReactNode—Replaces the sample button. It sits on a stage that provides the light as custom properties.
statusDepthStatus"ready"
messagesDepthMessages—
onRetry(() => void)—
disabledboolean—
classNamestring—

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.md

The index of every part is at /llms.txt.

More in Surfaces