Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Badge

A short label for a status, a count or a category.

Rendered by React 19.3.1

badge.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/badge.json

It also adds utils. The app needs its setup first: Installation.

Usage

Choose its look with variant. A badge is a span by default; render it as a link to make it one, as Button does.

import { Badge } from '@/components/ui/badge'

Examples

Default

The default, secondary, outline and destructive looks.

Its preview and code are at the top of the page.

API reference

Badge wraps no headless component of its own: its parts are elements with classes, and their props are the element's.