Badge
A status, a count or a tag, with the type and corner of the Tag input's chips. A new label or variant crossfades, and a count rolls to its new value inside an Animated number.
Examples
Variants
Six variants: default for what should be seen first, secondary for a quiet label, outline for a lighter one, and success, warning and destructive for what went well, what needs a look and what went wrong. secondary and outline take their colour from the text around them, so they read the same in a muted list or a picked tab.
Counts
A count in an AnimatedNumber rolls to its new value, and the badge glides to its new width.
Icons
An icon goes before the label and is sized for it. Keep the word: a colour or an icon alone doesn’t say the status to everyone.
Interview notes: Lumen Dental
Front desk staff book most appointments by phone and copy them into the calendar at the end of the day.
Links
With render, a badge is a link (or any element) that darkens on hover and shows a focus ring.
Installation
npx shadcn@latest add https://kinoui.com/r/badge.json- Files
lib/refs.tslib/reduce-motion.tslib/resize.tslib/swap.tsxcomponents/kino/badge.tsx- Packages
@base-ui/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
Props
Data attributes
Accessibility
- A badge is text, read where it sits. Name what a bare number counts with screen-reader text, such as
<span className='sr-only'> unread</span>. - A status never relies on colour alone: the word is always there, and an icon beside it is hidden from screen readers.
- A badge that is a link takes the controls’ focus ring. In forced colours it keeps its border, so its edge still shows.
- A count in an
AnimatedNumberis read once at its new value, never through the numbers between.