Measured entry

reui-badge

badgeminimal-flat

A compact React badge primitive shipped as a shadcn registry file. It renders a span or delegates through Radix Slot, with class-variance-authority handling color, size, and radius variants. Its styling assumes Tailwind utilities, project theme tokens, and a local cn helper.

Specimen
Harness screenshot of reui-badge at 375 pixels wide
Harness screenshot at 375 pixels wide. No horizontal overflow recorded.
Harness screenshot of reui-badge at 768 pixels wide
Harness screenshot at 768 pixels wide. No horizontal overflow recorded.
Harness screenshot of reui-badge at 1440 pixels wide
Harness screenshot at 1440 pixels wide. No horizontal overflow recorded.

Measured

Every value below was written by the harness on the run that produced the frames above. None of it is derived from the prose.

Harness measurements recorded for reui-badge
BuildOK
MountOK
Console errors0
Uncaught page errors0
Horizontal overflowclean at 375, 768, 1440
Axe critical0
Axe serious0
Axe moderate0
Axe minor0
Gzip marginal31.8 KB (97.2 KB build, 65.4 KB baseline)
Bare modeFAIL
Provider requiredNO
Demo usedwritten from the component source API

What the harness recorded

BARE BUILD

✗ Build failed in 1m 40s
error during build:
[vite:load-fallback] Could not load <sandbox>/src/lib/utils (imported by src/cut/badge.tsx): ENOENT: no such file or directory, open '<sandbox>/src/lib/utils'

Verdict

A solid fit for an existing ReUI or shadcn codebase, with a useful variant set and clean composition. It does not mount bare and needs a shadcn-style setup, including the utility helper, theme tokens, and styling pipeline.

Use it if

  • You already use shadcn conventions and want badges that share your theme tokens.
  • You need several semantic color treatments, compact sizes, and optional pill corners from one typed API.
  • You need composition through Radix Slot so another element can receive the badge styling.

Skip it if

  • Your project does not use Tailwind utilities or the expected theme token names.
  • You want a dependency-free label and do not need its broad variant matrix.
  • You need status announcements or interactive behavior built into the component rather than a styled span.

Install

Installation record for reui-badge
Declared dependenciesclass-variance-authority, radix-ui
Missing on installnone
Bare installfails once the shadcn-style helpers are removed, so it needs that setup
Providerno provider required in the harness

In a non-shadcn project, add class-variance-authority and Radix UI, provide the cn class-merging helper at the expected alias, configure the Tailwind utilities used by the component, and define its semantic color and ring tokens for light and dark themes.

Source and credit

This page is a review, not a copy. The component source lives with its author and this site does not republish it. Read the license before you use anything.

Alternatives

Other published entries for the badge pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.