Display

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 TokenSemantic TokenDefault Primitive Token
--badge-ring--ring--color-zinc-400
--badge-ring-destructive--destructive--color-red-50
--badge-radiusLiteral value9999px
--badge-border-defaultLiteral valuetransparent
--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-outlineLiteral valuetransparent
--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-ghostLiteral valuetransparent
--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-linkLiteral valuetransparent
--badge-fg-link--primary--color-zinc-900

Composition exports

BadgebadgeVariants

Usage 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`.