Skip to content

COMPONENT / data-readout-carousel

Data-Readout Carousel_

Framed slide viewer with a --signal 01 / 08 counter, bracketed PREV / NEXT buttons, arrow-key stepping and a segment strip. Slides change with a short stepped wipe, instant under reduced motion. Requires @cybr/tokens and @cybr/effects.

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/data-readout-carousel

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

Preview

SYSTEM READOUT
R-01 / UPTIME99.98%Rolling 30-day availability across all nodes.

Props

Component props
PropTypeDefaultDescription
labelstring—Required. The carousel's accessible name, also shown in the header bar.
slidesReactNode[]—Slide contents in order. Give each a key.
defaultIndex / indexnumber0Starting slide (uncontrolled) or the current slide (controlled). Values out of range clamp to the first or last slide.
onIndexChange(index: number) => void—Called with the new index when PREV, NEXT or an arrow key changes the slide.
loopbooleanfalseWrap from the last slide to the first and back. Without it, the buttons disable at the ends.
classNamestring—Extra classes, merged after the defaults with cn().
...propsOmit<ComponentProps<"section">, "children" | "aria-label">—Every other native <section> attribute and ref is forwarded. Your onKeyDown runs first; call preventDefault() to stop the arrow keys.

Usage

Needs both stylesheets from @cybr/tokens and @cybr/effects. After the install, import them in app/globals.css:

@import "tailwindcss";
@import "../styles/cybr-tokens.css";
@import "../styles/cybr-effects.css";
import { DataReadoutCarousel } from "@/components/ui/data-readout-carousel";

export function Readouts() {
  return (
    <DataReadoutCarousel
      label="SYSTEM READOUT"
      slides={[<p key="a">Uptime 99.98%</p>, <p key="b">Latency 42ms</p>]}
    />
  );
}

Behaviour

Accessibility