Skip to content

Gauge

Show a value against a known range.

DataChart
npx shadcn@latest add @silicon-ui/gauge

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/gauge

Manually

  1. Install the dependencies

    npm install motion
  2. Copy these files into your project

    • components/silicon-ui/gauge/gauge.tsx
    • components/silicon-ui/gauge/gauge.module.css
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { Gauge } from "@/components/silicon-ui/gauge/gauge";

API reference

PropTypeDefault
value*number—
label*string—
minnumber0
maxnumber100
detailstring—
toneGaugeTone

"danger""success""warning""accent"

"accent"
thresholdsGaugeThreshold[]—

Dependencies

npm
motion
Registry
silicon-motion-tokens