Badge Group
- Stable
- WCAG 2.2 evidence
- RTL
A pill that pairs a small badge with a short message, for an announcement or a status line. It is plain text by default, so a screen reader reads "New Payroll v2 is live"; with href the whole group
is one native link. The arrow is decorative and flips in right-to-left. Meaning never depends on the tone: the words say it
(WCAG 1.4.1). Presentational: renders in React Server Components, without React Aria. Consumer duties: write the badge and message so they make sense together and say the status in words ("Payroll v2 is live",
not only a green pill); keep link text meaningful out of context; for a plain status use Badge.
import { BadgeGroup } from "@nexera-ui/react";- 6
- examples
- 7
- props
- 2
- live controls
- 1
- platform
- 10
- WCAG criteria
- 0
- 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 { BadgeGroup } from "@nexera-ui/react";
<BadgeGroup />Examples 5
The same examples as Storybook, rendered live. Open Code to copy one.
As link
With href the whole group is one native link named "New Payroll v2 is live". The message is underlined on hover and keyboard focus shows the shared ring. Tab to it to see the ring.
import { BadgeGroup } from "@nexera-ui/react";
export function AsLink() {
return (
<div className="flex flex-col items-start gap-4">
<BadgeGroup badge="New" message="Payroll v2 is live" href="#payroll-v2" />
<BadgeGroup
type="trailing"
tone="success"
badge="Read more"
message="All payroll runs completed"
href="#payroll-runs"
/>
</div>
);
}
Arrow slot
The arrow is the Figma Show arrow: shown by default, null hides it, any node replaces it. It flips in right-to-left.
import { BadgeGroup } from "@nexera-ui/react";
import { LuSparkles } from "react-icons/lu";
export function ArrowSlot() {
return (
<div className="flex flex-col items-start gap-4">
<BadgeGroup badge="New" message="Default arrow" />
<BadgeGroup badge="New" message="No arrow" arrow={null} />
<BadgeGroup badge="New" message="Another icon" arrow={<LuSparkles />} />
<BadgeGroup type="trailing" badge="Read more" message="Arrow in the badge" arrow={null} />
</div>
);
}
Status in words
The tone supports the words: the status is written out, never only coloured.
import { BadgeGroup } from "@nexera-ui/react";
export function StatusInWords() {
return (
<div className="flex flex-col items-start gap-3">
<BadgeGroup
tone="success"
badge="Resolved"
message="Payroll export is working again"
arrow={null}
/>
<BadgeGroup
tone="warning"
badge="Delayed"
message="Bank transfers may take 2 days"
arrow={null}
/>
<BadgeGroup tone="danger" badge="Outage" message="Payroll export is failing" arrow={null} />
<BadgeGroup tone="neutral" badge="Info" message="Maintenance on Sunday" arrow={null} />
</div>
);
}
Long message
A long message wraps in a narrow container instead of being cut off; the pill grows taller.
import { BadgeGroup } from "@nexera-ui/react";
export function LongMessage() {
return (
<div className="max-w-xs">
<BadgeGroup
badge="New"
message="Payroll v2 is live for every company in your region, with automatic tax filing and instant payslips"
/>
</div>
);
}
Right to left
Right-to-left: a Leading group keeps the badge at the start (right) and the arrow points left, after the message.
import { BadgeGroup } from "@nexera-ui/react";
export function RightToLeft() {
return (
<div dir="rtl" lang="ar" className="flex flex-col items-start gap-4">
<BadgeGroup badge="جديد" message="الإصدار الثاني من الرواتب متاح الآن" href="#payroll" />
<BadgeGroup
type="trailing"
tone="success"
badge="اقرأ المزيد"
message="الإصدار الثاني من الرواتب متاح الآن"
href="#payroll"
/>
</div>
);
}
Props 7
Press "Try it" on a card to load that prop into the playground.
7 props shown
badge*NexeraReactNodeThe text of the small badge: one or two words that label the message ("New", "Update", "Beta").
message*NexeraReactNodeThe message: a short announcement. It wraps, it is never cut off. Write the meaning in words: the tone only supports it (WCAG 1.4.1).
arrowNexeraReactNodeThe arrow. Shown by default, as in the Figma default variant: an arrow
after the message in a Leading group and after the badge label in a Trailing group, flipped in right-to-left. Pass
another icon to replace it (decorative: hidden from assistive technology; wrap a directional icon in DirectionalIcon),
or null to hide it, which suits a group that is not a link.
typeNexera"leading" | "trailing"Where the badge sits: leading puts it before the message and the arrow after the message, trailing puts
it after the message with the arrow inside the badge ("Read more").
toneNexera"brand" | "neutral" | "success" | "warning" | "danger"Colour set.
sizeNexera"md" | "lg"Padding and type: 32 px or 38 px tall with a one-line message.
hrefNexerastringNot set: the group is plain text, not a link.
Where the announcement leads. The whole group becomes a native link (<a>) with a hover underline on the message and the
shared keyboard focus ring; its name is the badge text followed by the message. For client-side routing, pass the
onClick of your router or render your own link around a static group.
* 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 · 5 supporting- 1.1.1Non-text ContentLevel A · tested directly
- 1.3.1Info and RelationshipsLevel A · tested directly
- 1.3.2Meaningful SequenceLevel A · supporting test
- 1.4.1Use of ColorLevel A · supporting test
- 1.4.10ReflowLevel AA · supporting test
- 1.4.12Text SpacingLevel AA · supporting test
- 2.1.1KeyboardLevel A · tested directly
- 2.4.4Link Purpose (In Context)Level A · tested directly
- 2.4.7Focus VisibleLevel 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:.
<BadgeGroup className="shadow-sm" />Used in blocks
No block uses BadgeGroup yet.
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.
- BadgeOverflowThe "+N" pill that stands in for the badges a row has no room for.