uibrik

Gauge Dial

New

Preview

Customize

Value68
Target80
Accent

Usage

import { GaugeDial } from "@/components/uibrik/gauge-dial/gauge-dial";

<GaugeDial />

Installation

npx shadcn@latest add https://uibrik.com/r/gauge-dial.json
Adds the files to components/uibrik/gauge-dial and installs @number-flow/react, @tabler/icons-react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/gauge-dial.

Props

GaugeDial
title
Type string
"CPU load"
Names what is measured.
value
Type number
68
Current value. The dial follows it with a spring.
unit
Type string
"% used"
Small caption under the number.
target
Type number
80
A level to aim for, marked outside the arc.
showZone
Type boolean
true
Names the zone the value is in, in the card's corner.
interactive
Type boolean
true
Drag the knob or use the arrow keys.
accent
Type string
""
Arc colour. Empty uses the chart palette.
min
Type number
0
Value at the start of the sweep.
max
Type number
100
Value at the end of the sweep.
zones
Type { to: number; label: string; status: "good" | "warning" | "critical" }[]
–
Named ranges, in order. Empty uses healthy, elevated and critical at 60% and 85% of the range.
step
Type number
1
Snap size when dragging or using the keyboard.
format
Type Intl.NumberFormatOptions
{}
Formats the number.
onChange
Type (value: number) => void
–
Called as the value changes by drag or keyboard.
className
Type string
–
Classes for the outer shell.