VisorVisor
ComponentsAdmin

Infographic Bar

Composable continuous stat-card band. Lays out N stat-cards as a single infographic strip — outer corners rounded, inner corners square, hairline dividers, no full per-card borders. Theme-portable across bordered and borderless palettes.

Preview

A KPI row that reads as one continuous band — not four separate cards butting together. The band owns the frame, radius, and elevation; each stat-card sheds its own chrome.

Total Revenue

$48,120

+12.4%vs last monthup vs last month

Active Users

892

+3.1%up

Churn Rate

3.2%

-0.4%down

Avg. Session

4m 12s

0%flat

Highlighted cell

Set variant: "highlight" on any cell to tint it. Only the surface changes — the band's continuous frame and dividers stay intact.

MRR

$48,120

+12.4%up

New Trials

312

+8.1%up

Churned

24

-3.0%down

Compact density

Pass size="sm" to tighten every cell for dense dashboards.

Sessions

2,340

+8%up

Signups

412

+2%up

Bounce

28%

-1%down

Revenue

$12k

+5%up

Selectable band (a filter)

Pass value, defaultValue or onValueChange and the band becomes a filter: a radiogroup whose cells are radios, one pressed. Each cell draws its value over a sentence-case caption, and the pressed plate slides between cells. Arrow keys move focus and selection together; the band is one tab stop. The cell id is the value reported by onValueChange.

A selectable cell shows value and label only; delta, trend, footer, variant and valueAs apply to the read-only band.

Installation

npx visor add infographic-bar

This copies two files into your project:

  • components/ui/infographic-bar/infographic-bar.tsx — the component
  • components/ui/infographic-bar/infographic-bar.module.css — the styles

StatCard and ToggleGroup (the selectable band's radiogroup) are installed automatically as dependencies.

Usage

import { InfographicBar } from '@/components/ui/infographic-bar/infographic-bar';

export default function Example() {
  return (
    <InfographicBar
      stats={[
        { label: 'Total Revenue', value: '$48,120', delta: { value: '+12.4%', direction: 'up', label: 'vs last month' } },
        { label: 'Active Users', value: '892', delta: { value: '+3.1%', direction: 'up' } },
        { label: 'Churn Rate', value: '3.2%', delta: { value: '-0.4%', direction: 'down' } },
      ]}
    />
  );
}

Theming

InfographicBar is theme-agnostic and reads correctly in both bordered and borderless palettes:

  • Outer frame uses --border-default. Borderless themes set this to transparent, so the band's frame drops away and it melts into the page.
  • Dividers use --hairline — the house soft-separator token, lighter than a full border. Override --infographic-bar-divider to retune them, including transparent for a fully seamless band.
  • Corners round via overflow: hidden on the band, so outer cells round and inner cells stay square for any number of cells.

The selectable band has no border and sits on one tint:

  • Band is the page mixed 6% toward the ink (--infographic-bar-bg); on a pure-black page a 3% white layer fades in so the band still reads.
  • Pressed plate is a lifted plate on a light page (the page mixed 60% toward white, plus --shadow-sm) and a 9% ink wash in dark. It reads the page and the ink, not a mode class, so an always-dark theme's light mode still gets the wash. Override with --infographic-bar-plate-bg and --infographic-bar-plate-shadow.
  • Size follows the approval-inbox drawing: a 4px inset with concentric inner corners (--radius-xl less the inset, --infographic-bar-radius to retune), cells at least 124px wide (--infographic-bar-cell-min-width), a 44px count (--infographic-bar-value-size) and a 13px caption (--infographic-bar-caption-size). Below 720px the band spans its container and the count drops to 32px.

API Reference

InfographicBarProps

PropTypeDefaultDescription
stats*InfographicBarStat[]—Ordered stat cells, rendered left-to-right as a single continuous band. Each item is a subset of StatCardProps (label, value, delta, trend, trendPosition, footer, variant, valueAs) plus an optional id.
stats[].label*React.ReactNode—Label describing the metric. Uppercase in a read-only band; a selectable band draws it as a sentence-case caption under the value.
stats[].value*React.ReactNode—Prominent metric value rendered in a large display size.
stats[].deltaStatCardDelta—Change indicator with value, direction ("up" | "down" | "flat"), and optional context label.
stats[].variant'default' | 'highlight''default'Per-cell visual emphasis. Highlight tints that cell’s surface; the band frame and dividers stay continuous.
stats[].idstring—Stable React key for the cell, and its value in a selectable band. Falls back to the array index (as a string) when omitted.
size'sm' | 'md''md'Dimensional density forwarded to every cell of a read-only band.
valuestring—Selected cell id (controlled). Passing value, defaultValue or onValueChange makes the band selectable: a radiogroup filter with one cell pressed.
defaultValuestring—Uncontrolled initial selection. Falls back to the first cell.
onValueChange(value: string) => void—Fires with the newly selected cell id. Never fires with an empty string.
classNamestring—Additional CSS class names merged onto the band element.
...propsReact.HTMLAttributes<HTMLDivElement>—All standard HTML attributes are forwarded to the band div.

The component also forwards all standard HTML attributes to the band <div>.

InfographicBarStat

Each entry in stats is a subset of StatCardProps: label, value, delta, trend, trendPosition, footer, variant, valueAs, plus an optional id used as the React key.

Accessibility

Each cell is a StatCard, which announces its delta direction (up, down, flat) to screen readers via visually-hidden text alongside the visible glyph — color is never the sole signal. The cells default to <article> landmarks, so the band exposes one landmark per metric.

A selectable band is a radiogroup (name it with aria-label); each cell is a radio with aria-checked, named by its value and caption ("7 waiting"). Arrow keys move focus and selection together, and the band is one tab stop.