Controls

Gauge

Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Gauge

Gauge

A half dial of tick marks that light up to show a value within a range.

Installation

npx shadcn@latest add ikislay/pixel-ui/gauge

How to use

import { Gauge } from "@/components/ui/gauge"
export function Demo() {
return <Gauge label="Server load" value={68} caption="CPU load" format={(n) => Math.round(n) + "%"} />
}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
value*
number

The current value. It is clamped between min and max.

min
number

The value at the left end of the dial.

max
number

The value at the right end of the dial.

label*
string

Names the meter for screen readers.

caption
string

A short line under the value.

format
(value: number) => string

Formats values wherever the chart shows them. Defaults to short numbers like 12.4K.

color
string

Any CSS color for the lit ticks.

ticks
number

How many tick marks make up the dial.

className
string

Merged onto the root element.