Skip to content

Compass Dial

Pro

A heading-up compass dial: the rose turns with the heading, and a target on the ring shows which way to turn and how far.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 22, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

Compass Dial needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
27
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

Pass the heading and a target. Pair it with useDeviceHeading for a live phone compass.

heading-dial.tsx

CompassDial

<div>
PropTypeDefaultDescription
headingnumber | null—The heading in degrees: where the device faces (0 is north, clockwise). Feed it from useDeviceHeading, a GPS course, or any source. null or no value: no heading yet.
targetnumber | null—The target bearing in degrees, controlled. null: no target.
defaultTargetnumber | nullnullThe first target, uncontrolled. Default null.
onTargetChange—Each new target: a press or drag on the ring, a key. null when Delete clears it.
onTargetCommitted—The end of a change: a release or a key. Not on Escape.
tolerancenumberCOMPASS_TOLERANCEThe half width of "on course", in degrees. Default 3.
disabledbooleanfalse
readOnlybooleanfalseThe target shows and can be focused, but a press or a key does not change it.
namestring—The form name of the hidden range input (the target).
formstring—
labels—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

CompassDialRose

<svg>
PropTypeDefaultDescription
...props<svg> attributes—Every other attribute goes to the <svg>, with a ref.

CompassDialTarget

<svg>
PropTypeDefaultDescription
...props<svg> attributes—Every other attribute goes to the <svg>, with a ref.

CompassDialLubber

<svg>
PropTypeDefaultDescription
...props<svg> attributes—Every other attribute goes to the <svg>, with a ref.

CompassDialCenter

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

CompassDialValue

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

CompassDialHint

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.
  • Use it on a phone with useDeviceHeading: pass its heading, and show its status and requestAccess in your own UI.
  • Use heading from a GPS course or a data feed for a vehicle, a boat, or a drone.
  • Use target and onTargetChange to keep the target with a saved place; null is no target.
  • Use name to send the target with a form.
  • To set a bearing on a map with a baseplate that people move and turn, use a Compass.
  • For a plain angle in degrees, such as a rotation, use an Angle Dial.
Right ArroworUp ArrowTurns the target 1° clockwise.
Left ArroworDown ArrowTurns the target 1° back.
Shiftarrow keysTurns the target to the next 15°.
Page UporPage DownTurns the target 45°.
HomeSets the target to north.
DeleteorBackspaceClears the target.
EscapeStops a drag and keeps the target from before.
Rose
drift · the rose turns with the heading on a calm spring with no bounce
Arc
panel · a new target draws its arc out from the line
Ring
hover · a faint marker shows where a press sets the target

Built with

Installs with Compass Dial

Components
Input
  1. AddedCompass Dial, with Input.
Open the release