Skip to content

COMPONENT / telemetry-counter

Telemetry Counter_

Tabular-figure number that counts up from 0 the first time it scrolls into view. Requires @cybr/tokens.

Install

  1. 1. Map the @cybr namespace, once per project. Add this inside your components.json, or into its existing "registries" object. No components.json yet? Run npx shadcn@latest init first to create one.

    "registries": { "@cybr": "https://cybr-ui.com/r/{name}.json" }
  2. 2. Add components:

    $ npx shadcn@latest add @cybr/telemetry-counter

If shadcn reports Unknown registry "@cybr", step 1 is missing from that project's components.json.

Preview

REQ / S
1,284
LATENCY MS
12.4
NODES ONLINE
064

Props

Component props
PropTypeDefaultDescription
valuenumber—The final value. The counter animates from 0 to here.
decimalsnumber0Fraction digits, fixed for every frame so the width does not jump.
minDigitsnumber1Minimum integer digits, zero-padded (3 shows 64 as 064).
localestring"en-US"Intl.NumberFormat locale for grouping and the decimal mark. A fixed default keeps server and client output identical.
durationnumber2250Count length in ms, with an ease-out cubic curve.
classNamestring—Extra classes, merged after the defaults with cn().
...propsOmit<ComponentProps<"span">, "children">—Every other native <span> attribute and ref is forwarded.

Usage

Needs the stylesheet from @cybr/tokens, and @cybr/use-reduced-motion arrives with it. After the install, import the tokens in app/globals.css:

@import "tailwindcss";
@import "../styles/cybr-tokens.css";
import { TelemetryCounter } from "@/components/ui/telemetry-counter";

export function Throughput() {
  return <TelemetryCounter className="text-3xl" value={1284} />;
}

Behaviour

Accessibility