Skip to content
Search
Search the documentation
Badge
GitHub
1 min read

Badge

Small status and label pills with semantic intents.

Label a status, version, or category inline. Six intents cover the usual docs needs, neutral through danger, each driven by your theme tokens so they recolor with the rest of the site.

default primary secondary success warning danger outline

Usage

Import it and pick a variant. The default is default; pass href to turn the badge into a link.

			<script>
	import { Badge } from 'svelte-docsmith';
</script>

<Badge variant="success">Stable</Badge>
<Badge variant="warning">Beta</Badge>
<Badge variant="primary" href="/docs/introduction">New</Badge>
		

Try it

Every prop with a control below comes from Badge’s own types, the same ones the API reference is built from.

Badge
Controls
variant
href
external
<Badge>…</Badge>

API reference

Badge
variant 'default''primary''secondary''success''warning''danger''outline' default 'default'
Visual intent.
href string
Renders the badge as a link.
external boolean default false
For a linked badge, open in a new tab with rel="noopener noreferrer".
children required Snippet
The badge label.

Was this page helpful?