Badge
Badge is part of the Actions and feedback group. Compact status label for metadata, counts, and categorization.
Installation
Section titled “Installation”npx bambiui add badge --framework reactnpx bambiui add badge --framework solidnpx bambiui add badge --framework sveltenpx bambiui add badge --framework vueimport { Badge } from "@/components/ui/badge";
export function Example() { return <Badge />;}import { Badge } from "~/components/ui/badge";
export function Example() { return <Badge />;}<script lang="ts"> import { Badge } from "$lib/components/ui/badge";</script>
<Badge /><script setup lang="ts">import { Badge } from "@/components/ui/badge";</script>
<template> <Badge /></template>Preview
Section titled “Preview”
Badge preview should be verified in the target framework after copying the component source. Interactive behavior comes from generated public artifacts, not docs-only mock behavior.
Behavior
Section titled “Behavior”Use inside cards, tables, and headings to communicate short state.
Generated output uses serializable data-* attributes for state and styling. Controlled components fire bambi:<event-name> events and expect application state to update externally; uncontrolled components manage local source state and still fire events.
Accessibility
Section titled “Accessibility”Use semantic labels, visible focus states, and keyboard interaction patterns appropriate for Badge. Do not hide required instructions in transient UI. Verify focus movement and disabled states in the installed framework output.
Exports
Section titled “Exports”BadgeTokens
Section titled “Tokens”Customize tokens after installing and previewing the component. Relevant tokens include:
--bambi-muted--bambi-danger--bambi-success--bambi-warning