Badge
Labels status, metadata, counts, and compact classifications.
Imports
Use the same component slug for React, Vue, and style token lookup. Do not import components from package roots.
import { Badge, badgeVariants } from "@line/abc-def-react/badge";<script setup lang="ts">
import { Badge, badgeVariants } from "@line/abc-def-vue/badge";
</script>Shadcn references
Compare the corresponding shadcn React and Vue documentation for the same component slug.
Basic usage
Stable
import { Badge } from "@line/abc-def-react/badge";
export function Example() {
return <Badge variant="secondary">Stable</Badge>;
}<script setup lang="ts">
import { Badge } from "@line/abc-def-vue/badge";
</script>
<template>
<Badge variant="secondary">Stable</Badge>
</template>Component tokens
| Component Token | Semantic Token | Default Primitive Token |
|---|---|---|
--badge-ring | --ring | --color-zinc-400 |
--badge-ring-destructive | --destructive | --color-red-50 |
--badge-radius | Literal value | 9999px |
--badge-border-default | Literal value | transparent |
--badge-bg-default | --primary | --color-zinc-900 |
--badge-fg-default | --primary-foreground | --color-zinc-50 |
--badge-bg-default-hover | --primary | --color-zinc-900 |
--badge-fg-default-hover | --primary-foreground | --color-zinc-50 |
--badge-bg-secondary | --secondary | --color-zinc-100 |
--badge-fg-secondary | --secondary-foreground | --color-zinc-900 |
--badge-bg-secondary-hover | --secondary | --color-zinc-100 |
--badge-fg-secondary-hover | --secondary-foreground | --color-zinc-900 |
--badge-bg-destructive | --destructive | --color-red-50 |
--badge-fg-destructive | --destructive-foreground | --color-red-500 |
--badge-bg-destructive-hover | --destructive | --color-red-50 |
--badge-fg-destructive-hover | --destructive-foreground | --color-red-500 |
--badge-bg-outline | Literal value | transparent |
--badge-fg-outline | --foreground | --color-zinc-950 |
--badge-border-outline | --border | --color-zinc-200 |
--badge-bg-outline-hover | --accent | --color-zinc-100 |
--badge-fg-outline-hover | --accent-foreground | --color-zinc-900 |
--badge-bg-ghost | Literal value | transparent |
--badge-fg-ghost | --foreground | --color-zinc-950 |
--badge-bg-ghost-hover | --accent | --color-zinc-100 |
--badge-fg-ghost-hover | --accent-foreground | --color-zinc-900 |
--badge-bg-link | Literal value | transparent |
--badge-fg-link | --primary | --color-zinc-900 |
Composition exports
BadgebadgeVariantsUsage notes
- Use short labels.
- Use link styling only when the badge is genuinely navigational.
- Related component tokens use the `badge` token group in `@line/abc-def-styles/css`.