CraftUI

Badge

Ore UI's tags: flat blocks of color for statuses and labels.

OwnerOnlineNewBetaBannedRealms
OwnerOnlineNew

Installation

npx shadcn@latest add @runqora/craft-badge

Usage

import { Badge } from "@/components/craft/badge";

<Badge variant="primary">Online</Badge>;

Props

Badge

Prop

Type

Accessibility

  • Every variant holds its text at 4.5:1 or more.
  • A badge is plain text. Don't rely on its color alone: the words should say the status.

Customization

The variants follow Ore UI's tags. In its names, info is Informative, warning is Notice, destructive is Warning and accent is Realms Informative.

To style a link as a badge, use badgeVariants:

<a className={badgeVariants({ variant: "info" })} href="/news">
  New
</a>

Dependencies

Source

On this page