Skip to content
Search
Search the documentation
Badge
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>
		

API reference

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".
Edit this page Last updated: Jul 12, 2026

Was this page helpful?