logo-icon
STW UI

Badge

Badges are used to inform the user of the status of specific data.

Usage

svelte
import { Badge } from 'stwui';
// OR
import Badge from 'stwui/badge'; // for tree shaking

With Type

default info success warn error

With Custom Colors

bg-green-800 bg-blue-800 bg-red-800 bg-amber-800

With Size

Large Large Large Large Large

With Indicator

Indicator Indicator Indicator Indicator Indicator

With Shape

rounded rounded rounded rounded rounded
square square square square square

With Close

Close Close Close Close Close

Badge Props

type 'info' | 'warn' | 'success' | 'error' | undefined
size 'default' | 'large' default
shape 'default' | 'rounded' | 'square' default

Badge Slots

indicator <Badge.Indicator slot="indicator" />
default
close <Badge.Close slot="close" />

Badge Class Identifiers

stwui-badge
stwui-badge-close
stwui-badge-indicator