Meter preview

Interactive preview of the CyberSpec Meter component. A segmented gauge with thresholds that change its tone and print a word.

About this preview

Meter belongs to the Data group in the CyberSpec catalog. It uses @ui-sdk/react/meter.

Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/meter.json

Example

"use client"

import { Meter } from "@/components/ui/meter"

export default function MeterDemo() {
  return (
    <>
      <Meter label="Deck memory" value={10} max={50} />
      <Meter label="Heat" value={93} high={85} />
      <Meter label="Reserve cell" value={12} low={20} high={90} format={{ style: "percent" }} />
    </>
  )
}

Install this example

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/meter-demo.json

Resources

View as Markdown