Container
RequiredInline pill that carries the semantic tone.
spanActions & feedback
A compact, non-interactive label for status, category, or short metadata.
BadgeBadgePropsBadgeVariantConfigure the production component, inspect it at responsive widths, copy synchronized JSX, and share the exact state from one workspace.
This JSX stays synchronized with the controls and uses only public package APIs.
import { Badge } from '@ai-created/ui';
export function Example() {
return (
<Badge>
{"Ready"}
</Badge>
);
}
import { Badge } from '@ai-created/ui';Replace the version placeholder with the release tag your product has reviewed.
npm install --install-links "git+https://github.com/TheMarco/ai-created-ui.git#vX.Y.Z"@import '@ai-created/ui/styles/tokens.css';
@tailwind base;
@tailwind components;
@tailwind utilities;module.exports = {
presets: [require('@ai-created/ui/tailwind-preset')],
content: [
'./src/**/*.{js,ts,jsx,tsx,mdx}',
'./node_modules/@ai-created/ui/src/**/*.{js,ts,jsx,tsx}',
],
};Named regions define what belongs to the component, what remains optional, and where semantic responsibility lives.
Inline pill that carries the semantic tone.
spanShort status or category text.
The Figma-equivalent asset model, auto-layout, resizing, properties, slots, content bounds, localization, and governance contract.
Asset kind
component
Design library name
Components/Feedback/Badge
Maturity
stable
Last reviewed
2026-08-29
Canvas applicability
Publish as a component set with semantic tone variants and one text property.
| Property | Type | Default | Code mapping | Options or notes |
|---|---|---|---|---|
| Tone | variant | default | variant | default, muted, success, warning, error, info |
| LabelRequired | text | Ready | children | No additional constraint |
Status or classification text.
childrenOverflow: Do not truncate; replace with shorter vocabulary.
A badge is compact metadata, not explanatory content.
Translatable: Label
Always intrinsic.
No internal breakpoint
Accountable owner
Design systems feedback owner
Canonical source: src/components/Badge.tsx
These measurements and semantic tokens define the supported visual contract. Local overrides should preserve the same hierarchy and interaction cues.
Text size
11px
Horizontal padding
8px
Vertical padding
2px
Radius
9999px
Border
1px
--color-surface / --color-surface2Neutral fills.
--color-borderNeutral border.
--color-success / warning / info / errorSemantic text.
--color-*-surface / --color-*-borderSemantic fill and border pairs.
A component is not complete until its passive, interactive, disabled, and exceptional states remain understandable in both themes.
Semantics, accessible naming, keyboard behavior, focus and announcements are implementation requirements, not optional documentation.
No component-specific keyboard behavior. Native document behavior remains unchanged.
Use the public package API and preserve the controlled-state, native-attribute, and ref contracts described below.
import { Badge } from '@ai-created/ui';Server Component compatible
<Badge variant="success">Ready</Badge>These props and helpers are compatibility contracts. Changes require migration guidance and release notes.
| Prop | Type | Default | Contract |
|---|---|---|---|
| variant | BadgeVariant | default | default, muted, success, warning, error, or info. |
| className | string | undefined | Additional classes. |
| ...props | HTMLAttributes<HTMLSpanElement> | undefined | Native span attributes. |
These rules keep the component recognizable across products without preventing deliberate composition.
The component should be verified as rendered UI, an interaction model, an accessibility surface, and a theme-aware visual artifact.