Skip to main content
Clever Ops

Number Segment Meter

Discrete React meter primitive, value-of-max rendered as Tailwind-token unit cells that fill in stepped sequence, with a mono fraction readout and threshold tick.

Preview & code

Loading Number Segment Meter preview

Installation

pnpm dlx shadcn@latest add @cleverui/number-segment-meter

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { NumberSegmentMeter } from '@/components/ui/number-segment-meter'
Exampletsx
import { NumberSegmentMeter } from '@/components/ui/number-segment-meter'

export default function NumberSegmentMeterDemo() {
  return (
    <div className="mx-auto flex min-h-[320px] w-full max-w-lg flex-col justify-center px-4 py-16 sm:px-6">
      <div className="rounded-2xl border border-border/60 bg-card p-5 sm:p-6">
        <div className="mb-6 flex items-start justify-between gap-4">
          <div className="min-w-0">
            <p className="font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground sm:text-xs">
              Meridian Studio · Team plan
            </p>
            <p className="mt-2 text-lg font-semibold tracking-tight text-balance text-foreground">
              Seat capacity this billing cycle
            </p>
            <p className="mt-1.5 text-sm leading-relaxed text-muted-foreground">
              Seven of ten contracted seats are assigned. The tick marks the
              minimum roster before a cohort can launch.
            </p>
          </div>
          <span className="shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground sm:text-xs">
            INV-2408
          </span>
        </div>

        <NumberSegmentMeter
          value={7}
          max={10}
          label="Seats filled"
          readout="7 of 10"
          threshold={6}
          size="md"
        />
      </div>
    </div>
  )
}

API reference

NumberSegmentMeter accepts the following props.

PropTypeDefaultDescription
value*numberfilled units, a discrete quantity, e.g. seats taken or licenses used
maxnumber10total units drawn; keep it countable (24 or fewer)
labelstring'Seats filled'mono micro-label above the meter
readoutstringpreformatted fraction shown opposite the label, e.g. '7 of 10'
thresholdnumberunit boundary that draws a small foreground tick with sr-only meaning
size'sm' | 'md''md'cell height preset, md for standalone use, sm for dense rows

…plus everything from React.HTMLAttributes<HTMLDivElement>: className, event handlers, aria attributes and the rest pass straight through.

Frequently asked questions

How do I install the Number Segment Meter component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/number-segment-meter`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Number Segment Meter require?

Number Segment Meter uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Number Segment Meter to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services