Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

Badge

  • Stable
  • WCAG 2.2 evidence
  • RTL

Short status or category label: Tone x Variant x Size, with an optional dot, leading icon and remove button. The label is text, so the status is never conveyed by colour alone (WCAG 1.4.1); the dot and icon are decorative (1.1.1). Presentational: renders in React Server Components. The optional remove button is a small client island (BadgeRemoveButton), with a 24 px pointer target (2.5.8) and a visible keyboard focus ring (2.4.7). Consumer duties: label wording; announce removals that change results (for example "Filter removed") and move focus after a removal. Use Button or FilterChip for actions and filters.

import { Badge } from "@nexera-ui/react";
Loading example…
5
examples
8
props
5
live controls
1
platform
11
WCAG criteria
40
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.

Loading…
label
tone
variant
size
dot
Generated code
import { Badge } from "@nexera-ui/react";

<Badge />

Examples 4

The same examples as Storybook, rendered live. Open Code to copy one.

With icon

Figma Show icon (here Icon/LuCircleCheck) and Show dot off. Both are decorative; the label carries the meaning.

Loading example…

Removable

Figma Removable: onRemove adds a remove button named by removeLabel. The glyph is 12 or 14 px; the pointer target is 24 px. Tab to it to see the focus ring.

Loading example…

Long label

Long labels wrap inside a narrow container instead of being truncated (translations can add 30 to 40 %).

Loading example…

Right to left

Right-to-left: the dot and icon move to the start (right) and the padding mirrors.

Loading example…

Props 8

Press "Try it" on a card to load that prop into the playground.

8 props shown

label*Nexera
ReactNode

Text of the badge, for example "Active" or "On leave". It carries the meaning, so write the status in words: the colour only supports it (WCAG 1.4.1). Long labels wrap; they are never truncated.

Default –
toneNexera
"success" | "warning" | "danger" | "info" | "leave" | "remote" | "brand" | "neutral"

Colour set. leave and remote are the HR work statuses.

Default success
variantNexera
"soft" | "solid" | "outline"

Emphasis: tinted fill, solid fill, or a 1 px stroke without fill.

Default soft
sizeNexera
"sm" | "md" | "lg"

Padding and type: 18, 20 and 28 px tall with a one-line label.

Default sm
dotNexera
boolean

Show the leading dot. Decorative: hidden from assistive technology.

Default true
iconNexera
ReactNode

Icon before the label. Shown when provided, 12 px (14 px at lg), in the label colour. Decorative: hidden from assistive technology.

Default –
onRemoveNexera
() => void

Not set: the badge has no remove button. Shows the remove button and is called when it is activated. Accepts a Server Action. Move focus somewhere sensible after the badge is removed (for example to the next badge or the field).

Default –
removeLabelNexera
string

Only with onRemove. Accessible name of the remove button. Name what is removed, in your locale's word order, for example "Remove Engineering" (WCAG 2.4.6, 4.1.2).

Default –

* 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

5 direct · 6 supporting
  • 1.1.1Non-text ContentLevel A · tested directly
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.4.1Use of ColorLevel A · tested directly
  • 1.4.4Resize TextLevel AA · supporting test
  • 1.4.10ReflowLevel AA · supporting test
  • 1.4.11Non-text ContrastLevel AA · supporting test
  • 1.4.12Text SpacingLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.7Focus VisibleLevel AA · supporting test
  • 2.5.8Target Size (Minimum)Level 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.

0 px · drag the corner

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:.

Usage
<Badge className="shadow-sm" />

Used in blocks

Related components