---
title: "Angle Dial"
description: "Set an angle on a round dial: press to point the needle, drag to turn it, or type the value. 0° is at the top, as in CSS."
url: https://gelatinui.com/components/angle-dial
markdown_url: https://gelatinui.com/components/angle-dial.md
access: free
install: "npx shadcn@latest add @gelatin-ui/angle-dial"
registry_item: https://gelatinui.com/r/angle-dial.json
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Angle Dial

> Set an angle on a round dial: press to point the needle, drag to turn it, or type the value. 0° is at the top, as in CSS.

Page: https://gelatinui.com/components/angle-dial

## When to use it

Best for: Set an angle in degrees on a round dial, such as a gradient direction or a rotation.

- Use it when the value is a direction: 0° at the top, clockwise, as CSS `rotate` and `linear-gradient` angles.
- Use `variant="row"` in a design panel, next to Scrub Slider rows in a `ScrubSliderGroup`.
- Use `range="signed"` for a rotation from −180° to 180°.
- Use `name` to send the angle with a form.

## When not to use it

- For a value on a line, such as a size or an opacity, use a [Scrub Slider](https://gelatinui.com/components/scrub-slider.md).
- For a full gradient editor with stops and an angle, use a [Gradient Picker](https://gelatinui.com/components/gradient-picker.md).

## Notes for agents

- Compose it from `AngleDialDial`, `AngleDialLabel`, and `AngleDialValue`. In `variant="row"`, put the dial last.
- `onValueChange` runs on each step of a drag. `onValueCommitted` runs on release, on a key, and on a typed value, not on Escape.
- Use a `step` that divides 360, and a `snapStep` that is a multiple of `step`.
- Hold Shift while you drag to snap to `snapStep` (15° by default).
- Double-click the value, or press Enter on the dial, to type it. A typed value wraps: 400 becomes 40°.
- A hidden range input holds the focus and the form value, so it works as a native slider.

## Anatomy

```text
AngleDial
├─ AngleDialDial (0..n)
├─ AngleDialTicks (0..n)
├─ AngleDialNeedle (0..n)
├─ AngleDialLabel (0..n)
└─ AngleDialValue (0..n)
```

## API reference

### AngleDial

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `number` |  | The angle in degrees, controlled. |
| `defaultValue` | `number` |  | The first angle, uncontrolled. Default 0. |
| `onValueChange` | `function` |  | Each new angle: a press, each step of a drag, a key, a typed value. |
| `onValueCommitted` | `function` |  | The end of a change: a release, a key, a typed value. Not on Escape. |
| `range` | `AngleDialRange` | "wrap" | `wrap` (default): 0 to 359. `signed`: −180 to 180. Both wrap at the ends. |
| `step` | `number` | 1 | The step of a drag and of the arrow keys, in degrees. Use a step that divides 360. Default 1. |
| `snapStep` | `number` | ANGLE_DIAL.snapStep | The snap of Shift (a drag and Shift + arrow), in degrees. Default 15. Use a multiple of `step`: the value then snaps to the step grid, which would undo a snap between two steps. |
| `variant` | `AngleDialVariant` | "default" | `default`: the dial beside its text. `row`: a 32px panel row with a 24px dial at the end. |
| `size` | `AngleDialSize` | "default" | The dial: `sm` 24, `default` 64, `lg` 96. In a row: the row height, 28, 32, or 36. |
| `disabled` | `boolean` | false |  |
| `readOnly` | `boolean` | false | The value shows and can be focused, read, and submitted, but not changed. |
| `name` | `string` |  | The form name of the hidden range input. |
| `form` | `string` |  | The `form` of the hidden range input, for a dial outside its form. |
| `locale` | `string` |  | The locale of the number format. |
| `format` | `NumberFormatOptions` |  | The format of the shown value. Default: the narrow degree unit with the digits of the step. |
| `getAriaValueText` | `function` |  | The spoken value (`aria-valuetext`). Default: "135 degrees" in the locale. |

### AngleDialDial

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### AngleDialTicks

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### AngleDialNeedle

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### AngleDialLabel

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### AngleDialValue

No props of its own: `className`, `children`, and every other prop go to the element it renders.

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| AngleDial | `angle-dial` | `data-disabled`, `data-dragging`, `data-focus-visible`, `data-readonly`, `data-snapping` | `--radius` | `hit-area`, `motion-timing` |
| AngleDialDial | `angle-dial-dial` |  |  |  |
| AngleDialTicks | `angle-dial-ticks` |  |  |  |
| AngleDialNeedle | `angle-dial-needle` |  | `--angle-dial-rotate` |  |
| AngleDialLabel | `angle-dial-label` |  |  |  |
| AngleDialValue | `angle-dial-value` |  |  |  |

## Usage

Compose the dial, the label, and the value. 0° is at the top, and the angle grows clockwise.

```tsx title="angle-dial.tsx"
import { AngleDial, AngleDialDial, AngleDialLabel, AngleDialValue } from "@/components/ui/angle-dial";

export function AngleDialDemo() {
  return (
    <AngleDial defaultValue={135}>
      <AngleDialDial />
      <AngleDialLabel>Angle</AngleDialLabel>
      <AngleDialValue />
    </AngleDial>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/angle-dial
```

It adds 37 registry items: 34 files, 7261 lines, and the npm packages `@base-ui/react`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Scrub Slider](https://gelatinui.com/components/scrub-slider.md)
- [Gradient Picker](https://gelatinui.com/components/gradient-picker.md)
- [Slider](https://gelatinui.com/components/slider.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Right Arrow, Up Arrow | Turns the angle 1 step clockwise. |
| Left Arrow, Down Arrow | Turns the angle 1 step back. |
| Shift + arrow keys | Turns the angle to the next snap step (15° by default). |
| Page Up, Page Down | Turns the angle 45°. |
| Home, End | Sets the first or the last angle of the range. |
| Enter | Opens the value field to type an angle. |
| Escape | Stops a drag or the typing and keeps the angle from before. |

## Motion

| Part | Motion |
| --- | --- |
| Ticks | hover · the ticks get brighter on hover, focus, and drag |
| Knob | press · the knob grows to 125% while you drag |
