byronwade/ui
Application UI

Primitives · Application UI

Badge

A small inline label component with multiple semantic variants (default, secondary, destructive, success, warning, outline, ghost, link) built on Base UI's useRender for polymorphic rendering.

Feature showcase

Installation

Features

  • 6 examples

    Default, As Link, Inline Content, Invalid, Status, With Icon.

API

Props

PropTypeDefaultDescription
variant"default" | "secondary" | "destructive" | "success" | "warning" | "outline" | "ghost" | "link""default"Visual style variant controlling color and appearance of the badge.
renderuseRender.RenderProp<"span">-Base UI render prop for polymorphic rendering, override the default span element.
classNamestring-Additional CSS class names merged with the variant styles.

Source and related

FilePath
Componentregistry/ui/badge.tsx
Default examplecontent/examples/badge/default.tsx
As Link examplecontent/examples/badge/as-link.tsx
Inline Content examplecontent/examples/badge/inline-content.tsx
Invalid examplecontent/examples/badge/invalid.tsx
Status examplecontent/examples/badge/status.tsx
With Icon examplecontent/examples/badge/with-icon.tsx