Badge
Badge with accessible presentation and local state.
Installation
Install the shared package once in your Exact app. This version is a beta.
bun add --exact @rightui/ui@0.4.0-beta.4
The Exact compiler requires Bun 1.4.2, regardless of which package manager installs the package.
Complete the font, app metadata and root provider setup (required for both installation methods).
Import
use Badge, BadgeWithOptions, BadgeOptions, BadgeContent, BadgeIcon, BadgeSpinner from "@rightui/ui"
Usage
Import Badge(label, variant) for the legacy wrapper, or BadgeWithOptions(label, variant, options) with BadgeOptions(icon, trailingIcon, href, fill, ink, direction, invalid). Supply every options field explicitly; empty strings select no icon/link or default colors. Use BadgeContent for slotted content, BadgeIcon for named SVG icons and BadgeSpinner(reduced, label) for status. BadgeContent requires variant, href, fill, ink, direction, invalid and iconPosition. Variants are default, secondary, destructive, outline, ghost and link; primary and success remain accepted.
API Reference
Properties from the component source. State lives in your component; actions receive the updated value.
BadgeContent.variant
string
BadgeContent.href
string
BadgeContent.fill
string
BadgeContent.ink
string
BadgeContent.direction
string
BadgeContent.invalid
bool
BadgeContent.iconPosition
string
BadgeIcon.name
string
BadgeSpinner.reduced
bool
BadgeSpinner.label
string
BadgeWithOptions.label
string
BadgeWithOptions.variant
string
BadgeWithOptions.options
BadgeOptions
Badge.label
string
Badge.variant
string