Skip to content
Data Display Core Stable

Badge

.md

A short pill of status text in five treatments and two sizes, with native span attributes passed through

Available for Svelte 5, React, and Vue 3.

Preview

Installation

pnpm add fancy-ui-svelte
import { Badge } from "fancy-ui-svelte";

Usage

svelte
<script lang="ts">
	import { Badge } from "fancy-ui-svelte";
</script>

<div class="flex flex-wrap items-center gap-2">
	<Badge>Default</Badge>
	<Badge variant="secondary">Secondary</Badge>
	<Badge variant="outline">Outline</Badge>
	<Badge variant="destructive">Destructive</Badge>
	<Badge variant="success">Success</Badge>
</div>

Examples

Basic Usage

The five variants, each with a visible word.

Sizes

Compact and regular, beside the rows they describe.

Props

PropTypeDefaultDescription
variant "default" | "secondary" | "outline" | "destructive" | "success""default"Visual treatment. Always pair it with a visible word: colour is never the message
size "sm" | "md""md"Compact or regular
class string-Additional CSS classes

Slots

SlotDescription
children The label