Skip to content

Commit

Permalink
Document badge component (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
micheal-parks authored Jul 27, 2023
1 parent 25483eb commit 429b06d
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions packages/core/src/lib/badge.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
<!--
@component
The badge is often used to display status information.
```svelte
<Badge
variant='green'
label='Active'
/>
```
-->
<svelte:options immutable />

<script lang="ts">
type Variants = 'green' | 'orange' | 'red' | 'gray' | 'blue';
import cx from 'classnames';
/**
* The badge text.
*/
export let label = '';
export let variant: Variants = 'gray';
/**
* The color theme of the badge.
*/
export let variant: 'green' | 'orange' | 'red' | 'gray' | 'blue' = 'gray';
</script>

<small
Expand Down

0 comments on commit 429b06d

Please sign in to comment.