Badge components

FREE

Free and open-source React badge components built for modern applications and websites. These badges are built using React Aria and styled with Tailwind CSS.

LabelLabelLabel

Installation

You can add this badge component using our CLI or manually:

npx untitledui@latest add badges

Badge examples

Below are examples and variations of this badge component:

LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
AU flagLabelAU flagLabelAU flagLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
Badge imageLabelBadge imageLabelBadge imageLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel
LabelLabelLabel

API reference

Badge

Import Badge from @/components/base/badges/badges. Renders a <span> element.

Badge props
PropTypeDefaultDescription
children* (required)ReactNode—The content of the badge, usually a short text label.
type
"modern""pill-color""color"
"pill-color"The shape and treatment of the badge: pill-color is fully rounded, color is a rounded rectangle, and modern is a white badge with a border and a subtle shadow.
size
"sm""md""lg"
"md"Controls the padding and font size of the badge.
color
"brand""warning""error""gray""success""slate""sky""blue""indigo""purple""pink""orange"
"gray"The color palette used for the badge background, text, and ring. The modern type only supports gray.
classNamestring—Additional CSS classes merged onto the badge element.

BadgeIcon

Import BadgeIcon from @/components/base/badges/badges. Renders a <span> element.

BadgeIcon props
PropTypeDefaultDescription
icon* (required)IconComponentType—The icon component rendered as the sole content of the badge.
type
"modern""pill-color""color"
"pill-color"The shape and treatment of the badge: pill-color is fully rounded, color is a rounded rectangle, and modern is a white badge with a border and a subtle shadow.
size
"sm""md""lg"
"md"Controls the padding around the icon, which sets the overall size of the badge.
color
"brand""warning""error""gray""success""slate""sky""blue""indigo""purple""pink""orange"
"gray"The color palette used for the badge background, ring, and icon. The modern type only supports gray.
childrenReactNode—Accepted for consistency with the other badges but not rendered — this badge shows only the icon.

BadgeWithButton

Import BadgeWithButton from @/components/base/badges/badges. Renders a <span> element.

BadgeWithButton props
PropTypeDefaultDescription
children* (required)ReactNode—The content shown before the button, usually a short text label.
type
"modern""pill-color""color"
"pill-color"The shape and treatment of the badge: pill-color is fully rounded, color is a rounded rectangle, and modern is a white badge with a border and a subtle shadow.
size
"sm""md""lg"
"md"Controls the gap, padding, and font size of the badge.
iconIconComponentTypeCloseXThe icon component rendered inside the trailing button, typically a dismiss icon.
color
"brand""warning""error""gray""success""slate""sky""blue""indigo""purple""pink""orange"
"gray"The color palette used for the badge background, text, ring, and the trailing button's hover state. The modern type only supports gray.
buttonLabelstring—The label for the button.
onButtonClickMouseEventHandler<HTMLButtonElement>—The click event handler for the button.

BadgeWithDot

Import BadgeWithDot from @/components/base/badges/badges. Renders a <span> element.

BadgeWithDot props
PropTypeDefaultDescription
children* (required)ReactNode—The content shown after the dot, usually a short status label.
type
"modern""pill-color""color"
"pill-color"The shape and treatment of the badge: pill-color is fully rounded, color is a rounded rectangle, and modern is a white badge with a border and a subtle shadow.
size
"sm""md""lg"
"md"Controls the gap, padding, and font size of the badge.
color
"brand""warning""error""gray""success""slate""sky""blue""indigo""purple""pink""orange"
"gray"The color palette used for the badge background, text, ring, and the leading dot. With the modern type only the dot is colored.
classNamestring—Additional CSS classes merged onto the badge element.

BadgeWithFlag

Import BadgeWithFlag from @/components/base/badges/badges. Renders a <span> element.

BadgeWithFlag props
PropTypeDefaultDescription
children* (required)ReactNode—The content shown after the flag, usually a country or region name.
type
"modern""pill-color""color"
"pill-color"The shape and treatment of the badge: pill-color is fully rounded, color is a rounded rectangle, and modern is a white badge with a border and a subtle shadow.
size
"sm""md""lg"
"md"Controls the gap, padding, and font size of the badge.
flag
"AD""AE""AF""AG""AI""AL""AM""AO""AR""AS""AT""AU""AW""AX"
+228 more
"AZ""BA""BB""BD""BE""BF""BG""BH""BI""BJ""BL""BM""BN""BO""BQ-1""BQ-2""BQ""BR""BS""BT""BW""BY""BZ""CA""CC""CD-1""CD""CF""CH""CK""CL""CM""CN""CO""CR""CU""CW""CX""CY""CZ""DE""DJ""DK""DM""DO""DS""DZ""earth""EC""EE""EG""EH""ER""ES""ET""FI""FJ""FK""FM""FO""FR""GA""GB-2""GB""GD""GE""GG""GH""GI""GL""GM""GN""GQ""GR""GT""GU""GW""GY""HK""HN""HR""HT""HU""ID""IE""IL""IM""IN""IO""IQ""IR""IS""IT""JE""JM""JO""JP""KE""KG""KH""KI""KM""KN""KP""KR""KW""KY""KZ""LA""LB""LC""LI""LK""LR""LS""LT""LU""LV""LY""MA""MC""MD""ME""MG""MH""MK""ML""MM""MN""MO""MP""MQ""MR""MS""MT""MU""MV""MW""MX""MY""MZ""NA""NE""NF""NG""NI""NL""NO""NP""NR""NU""NZ""OM""PA""PE""PF""PG""PH""PK""PL""PM""PN""PR""PT""PW""PY""QA""RE""RO""RS""RU""RW""SA""SB""SC""SD""SE""SG""SH""SI""SJ""SK""SL""SM""SN""SO""SR""SS""ST""SV""SX""SY""SZ""TC""TD""TF""TG""TH""TJ""TK""TL""TM""TN""TO""TR""TT""TV""TZ""UA""UG""UM""US""UY""UZ""VA""VC""VE""VG""VI""VN""VU""WF""WS""YE""YT""ZA""ZM""ZW"
"AU"The ISO country code of the flag shown before the label. It is loaded as a circular SVG from the Untitled UI flag CDN and also used for the image alt text.
color
"brand""warning""error""gray""success""slate""sky""blue""indigo""purple""pink""orange"
"gray"The color palette used for the badge background, text, and ring. The modern type only supports gray.

BadgeWithIcon

Import BadgeWithIcon from @/components/base/badges/badges. Renders a <span> element.

BadgeWithIcon props
PropTypeDefaultDescription
children* (required)ReactNode—The content shown between the icons, usually a short text label.
type
"modern""pill-color""color"
"pill-color"The shape and treatment of the badge: pill-color is fully rounded, color is a rounded rectangle, and modern is a white badge with a border and a subtle shadow.
size
"sm""md""lg"
"md"Controls the gap, padding, and font size of the badge.
color
"brand""warning""error""gray""success""slate""sky""blue""indigo""purple""pink""orange"
"gray"The color palette used for the badge background, text, ring, and icons. With the modern type only the icons are colored.
iconLeadingIconComponentType—An icon component rendered before the label. Providing it also switches the badge to the tighter leading padding.
iconTrailingIconComponentType—An icon component rendered after the label.
classNamestring—Additional CSS classes merged onto the badge element.

BadgeWithImage

Import BadgeWithImage from @/components/base/badges/badges. Renders a <span> element.

BadgeWithImage props
PropTypeDefaultDescription
imgSrc* (required)string—The source URL of the circular image rendered before the label, such as an avatar or a logo.
children* (required)ReactNode—The content shown after the image, usually a name or a short label.
type
"modern""pill-color""color"
"pill-color"The shape and treatment of the badge: pill-color is fully rounded, color is a rounded rectangle, and modern is a white badge with a border and a subtle shadow.
size
"sm""md""lg"
"md"Controls the gap, padding, and font size of the badge.
color
"brand""warning""error""gray""success""slate""sky""blue""indigo""purple""pink""orange"
"gray"The color palette used for the badge background, text, and ring. The modern type only supports gray.

FAQs

Please refer to our frequently asked questions page for more.

Set the color prop to "gray", "brand", "error", "warning", "success", "slate", "sky", "blue", "indigo", "purple", "pink" or "orange". The default is "gray".

Set type to "pill-color" (the default, fully rounded), "color" (rounded rectangle) or "modern" (white background with a border and a subtle shadow). On Badge, BadgeWithFlag, BadgeWithImage, BadgeWithButton and BadgeIcon, the "modern" type only supports "gray", while BadgeWithDot and BadgeWithIcon accept any color and use it for the dot or icon.

Yes. Use BadgeWithIcon with iconLeading or iconTrailing, BadgeIcon with an icon prop for an icon-only badge, or BadgeWithDot for a status dot. Pass icons as component references, for example iconLeading={ArrowUp}.

Badges support "sm", "md" and "lg" through the size prop. The default is "md".

Yes. BadgeWithImage takes an imgSrc URL, and BadgeWithFlag takes a flag country code such as "US" or "DE" (it defaults to "AU"). Both support the same size, color and type options as Badge.

Use BadgeWithButton and handle clicks with onButtonClick. It shows an X icon by default, which you can swap with the icon prop. Always pass buttonLabel, since it becomes the button's aria-label and the button has no visible text.