GitHubGitHub
← All widgets
Analytics / widget

KPI period bars

Status-tinted period bars with an active hatch, target reference, responsive geometry, and focusable tooltip detail.

NormalWarningCriticalActiveNo data
79.186.694.2101.7109.2Target 9608:0009:0010:0011:0012:00
<KpiPeriodBars points={periods} target={96} unit="%" />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { KpiPeriodBars } from '@chanrg/4ui';<KpiPeriodBars points={periods} target={96} unit="%" />

API reference

Props

PropTypeDefaultDescription
pointsKpiPeriod[][]Ordered periods.
targetnumber | nullnullVisible target reference.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Each bar is keyboard focusable and has a complete period/value/status label.

Dependencies

numeric formatting helper