# Badge (@limerdev/zest) A short label for a status, a category or a count: `` with a `variant` colour (`primary`, `secondary`, `neutral`, `outline`, or a status: `info`, `success`, `warning`, `error`). An icon before the text is sized for it. With the `child` snippet it renders a link or another element. - Category: Data display - Import: `import { Badge, badgeVariants } from '@limerdev/zest'` - Exports: `Badge`, `badgeVariants` - Use for: An invoice's status in a table row, a role beside a name, a count beside a tab. - Don't: Something to click that does an action: use `Button` (`size="sm"`). A long message: use `Alert`. Colour alone for meaning: the text must say it. ```svelte Paid Due soon Draft ``` Props of `Badge`: - `variant` (`"primary" | "secondary" | "neutral" | "error" | "outline" | "info" | "success" | "warning"`, default `'primary'`): The colour: `primary`, `secondary`, `neutral`, `outline`, or a status (`info`, `success`, `warning`, `error`). Example: Variants The variants: primary by default, the other theme colours and the statuses. ```svelte
New Secondary Neutral Draft Sent Paid Due soon Overdue
``` Example: Icons and links An icon before the text is sized for the badge; the child snippet makes it a link. ```svelte
{#snippet child({ props })} 12 invoices {/snippet}
```