---
title: "Thermostat Dial"
description: "Set a temperature on a round dial: drag around the ring, or use the arrow keys."
url: https://gelatinui.com/components/thermostat-dial
markdown_url: https://gelatinui.com/components/thermostat-dial.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/thermostat-dial"
version: "2026-11-21"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Thermostat Dial

> Set a temperature on a round dial: drag around the ring, or use the arrow keys.

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

## When to use it

Best for: Set one temperature in a range on a large round dial, with a drag or the keys.

- Use it as the main control of a room or device screen, where the value is the point of the page.
- Set `min`, `max`, `step`, and `unit` for Fahrenheit or another unit. The number gets smaller to stay in the face.
- Use `onValueCommitted` to save the value once, when a drag or a key press ends.

## When not to use it

- To set a value on a straight track in a form or a toolbar, use the [Slider](https://gelatinui.com/components/slider.md).
- To set an angle from 0° to 360°, use the [Angle Dial](https://gelatinui.com/components/angle-dial.md).

## Notes for agents

- The defaults are a room thermostat in Celsius: `min` 16, `max` 30, `step` 0.5, `largeStep` 2, `defaultValue` 21, `unit` `°`.
- It takes the Slider props (`value`, `onValueChange`, `onValueCommitted`, `name`, `format`, `disabled`). `format` is `Intl.NumberFormatOptions`; the default shows one decimal.
- With no children it renders `ThermostatDialTicks`, `ThermostatDialFace` with `ThermostatDialValue`, and `ThermostatDialRange`. Give it `aria-label`, or put a `ThermostatDialLabel` in the face.
- `readOnly` keeps the focus and the form value, but a drag or a key does not change it.

## Anatomy

```text
ThermostatDial
├─ ThermostatDialTicks (0..n)
├─ ThermostatDialFace (0..n)
├─ ThermostatDialLabel (0..n)
├─ ThermostatDialValue (0..n)
└─ ThermostatDialRange (0..n)
```

## API reference

### ThermostatDial

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `thumbProps` | `Omit<SliderThumbProps, "index">` |  | Props for every default thumb: `getAriaLabel`, `getAriaValueText`, `aria-label`, `disabled`. |
| `unit` | `string` | "°" | The text after each number. Default `°`. |
| `readOnly` | `boolean` | false | The value shows and can be focused and submitted, but not changed. |
| `locale` | `string` |  | The locale of the numbers. Default: the `DisplayLocaleProvider` locale, else `en-US`. |

Also takes every prop of Base UI `Slider.Root`: https://base-ui.com/react/components/slider

### ThermostatDialTicks

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

### ThermostatDialFace

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

### ThermostatDialLabel

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### ThermostatDialValue

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### ThermostatDialRange

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

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| ThermostatDial | `thermostat-dial` |  |  |  |
| ThermostatDialTicks | `thermostat-dial-ticks` | `data-current` |  | `motion-timing` |
| ThermostatDialFace | `thermostat-dial-face` |  |  |  |
| ThermostatDialLabel | `thermostat-dial-label` |  |  |  |
| ThermostatDialValue | `thermostat-dial-value` |  |  |  |
| ThermostatDialRange | `thermostat-dial-range` |  |  |  |

## Usage

Put the label and the value in the face. Save the value when a drag ends.

```tsx title="room-temperature.tsx"
"use client";

import { useState } from "react";

import {
  ThermostatDial,
  ThermostatDialFace,
  ThermostatDialLabel,
  ThermostatDialRange,
  ThermostatDialTicks,
  ThermostatDialValue,
} from "@/components/pro/controls/thermostat-dial";

export function RoomTemperature() {
  const [saved, setSaved] = useState(21);
  return (
    <div className="flex flex-col items-center gap-3">
      <ThermostatDial name="living-room" defaultValue={saved} onValueCommitted={setSaved}>
        <ThermostatDialTicks />
        <ThermostatDialFace>
          <ThermostatDialLabel>Living room</ThermostatDialLabel>
          <ThermostatDialValue />
        </ThermostatDialFace>
        <ThermostatDialRange />
      </ThermostatDial>
      <p className="text-sm text-muted-foreground">Heating to {saved.toFixed(1)}°</p>
    </div>
  );
}
```

## 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-pro/thermostat-dial
```

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

## Built on

- [Direction](https://gelatinui.com/components/direction.md)
- [Slider](https://gelatinui.com/components/slider.md)

## 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

- [Slider](https://gelatinui.com/components/slider.md)
- [Angle Dial](https://gelatinui.com/components/angle-dial.md)
- [Number Field](https://gelatinui.com/components/number-field.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Right Arrow, Up Arrow | Raises the value one step. |
| Left Arrow, Down Arrow | Lowers the value one step. |
| Page Up, Page Down, Shift + Arrow | Moves the value one large step. |
| Home, End | Goes to the lowest or the highest value. |

## Accessibility

The value is a range input: one tab stop, with the formatted value and the unit as its value text.

The ring turns clockwise in every text direction, so the Right and Up arrows always raise the value.

The ring around the face is 44px wide or more on every size, so a finger can always take it. On touch, the center of the face scrolls the page.

## Motion

| Part | Motion |
| --- | --- |
| Needle | follow · a spring with a small overshoot, as a real pointer |
| Number | roll · the number counts to each new value, with no bounce |
| Value tick | hover · the tick at the value grows |
| Glow | fade · the glow in the color of the value grows while you drag |
