Metric Mini
- Stable
- WCAG 2.2 evidence
- RTL
A small figure with its label and a one-line caption, for secondary numbers such as a leave balance
next to a profile. Use MetricCard for headline numbers with a trend or chart. Presentational: no state and no "use client", so it renders in React Server Components. The text order is label, value,
caption, so screen readers get the name before the number; nothing is conveyed by colour (WCAG 1.3.1, 1.4.1) and long or
translated text wraps (1.4.10, 1.4.12). Consumer duties: the label and caption wording and locale-aware formatting of
the value.
import { MetricMini } from "@nexera-ui/react";- 5
- examples
- 3
- props
- 1
- live controls
- 1
- platform
- 5
- WCAG criteria
- 3
- blocks use it
Try every prop. Copy the code.
Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.
import { MetricMini } from "@nexera-ui/react";
<MetricMini />Examples 4
The same examples as Storybook, rendered live. Open Code to copy one.
In a grid
Tiles in a responsive grid: they fill their cells, and a missing caption leaves the tile shorter.
import { MetricMini } from "@nexera-ui/react";
export function InAGrid() {
return (
<div className="grid grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] gap-3">
<MetricMini label="Annual leave" value="12 days" caption="of 20 left" />
<MetricMini label="Sick leave" value="3 days" caption="of 10 left" />
<MetricMini label="Remote days" value="8" caption="this month" />
<MetricMini label="Overtime" value="4.5 h" />
</div>
);
}
Long content
Long and translated text wraps in the tile; nothing is truncated.
import { MetricMini } from "@nexera-ui/react";
<MetricMini
label="Anzahl der verbleibenden Urlaubstage im laufenden Kalenderjahr"
value="12 Tage"
caption="von insgesamt 20 Tagen, einschliesslich Uebertrag"
/>;
Right to left
Right-to-left: the text aligns to the start (right) edge.
import { MetricMini } from "@nexera-ui/react";
<MetricMini label="الإجازة السنوية" value="١٢ يومًا" caption="من أصل ٢٠ متبقية" />;
Narrow container
A 14 rem container: the tile keeps its padding and the text wraps.
import { MetricMini } from "@nexera-ui/react";
<div className="max-w-56">
<MetricMini label="Annual leave" value="12 days" caption="of 20 left" />
</div>;
Props 3
Press "Try it" on a card to load that prop into the playground.
3 props shown
label*NexeraReactNodeWhat is measured. Short noun phrase; it wraps instead of truncating. It is read first, so the value that follows always has its name.
value*NexerastringThe figure. Format numbers, dates and currency for the reader's locale and
include the unit; Intl.NumberFormat is the right tool.
captionNexeraReactNodeContext for the figure. Shown when provided.
* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.
Accessible by default.
Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.
WCAG 2.2 evidence
3 direct · 2 supporting- 1.3.1Info and RelationshipsLevel A · tested directly
- 1.4.1Use of ColorLevel A · tested directly
- 1.4.10ReflowLevel AA · supporting test
- 1.4.12Text SpacingLevel AA · supporting test
- 4.1.2Name, Role, ValueLevel A · tested directly
Fits any width.
Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.
Styling hooks
Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.
<MetricMini className="shadow-sm" />Used in blocks
- Recruitment funnelDashboards and analytics
- Engagement survey resultsDashboards and analytics
- Live status boardDashboards and analytics
Related components
- AccordionItemOne collapsible section of an FAQ or settings page.
- AreaChartA stacked area chart: layers piled up over time with the title, range switch, actions and legend of the card.
- AvailabilityRowOne person's availability across a window of the day: an avatar with initials and the name, and a timeline with the busy periods drawn as bars.
- AvatarA person or organisation shown as a photo, initials or an icon.
- AvatarGroupA row of overlapping avatars with a "+N" chip for the rest.
- AvatarLabelAn avatar with a name and an optional subtitle beside it, for a person in a list, a header or a mention.
- BadgeShort status or category label: `Tone` x `Variant` x `Size`, with an optional dot, leading icon and remove button.
- BadgeGroupA pill that pairs a small badge with a short message, for an announcement or a status line.