-
-
Notifications
You must be signed in to change notification settings - Fork 282
Expand file tree
/
Copy path_Simple.svelte
More file actions
30 lines (27 loc) · 823 Bytes
/
_Simple.svelte
File metadata and controls
30 lines (27 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!--
Note: chips must be unique. (They cannot === each other.)
If you need to show the same value, use keyed chips.
-->
<Set chips={['one', 'two', 'three', 'four', 'five']}>
{#snippet chip(chip)}
<!-- Note: the `chip` property is required! -->
<Chip
{chip}
shouldRemoveOnTrailingIconClick={false}
onclick={() => clicked++}
>
{#if chip === 'four'}
<LeadingIcon class="material-icons">book</LeadingIcon>
{/if}
<Text tabindex={0}>{chip}</Text>
{#if chip === 'five'}
<TrailingIcon class="material-icons">commute</TrailingIcon>
{/if}
</Chip>
{/snippet}
</Set>
<pre class="status">Clicked: {clicked}</pre>
<script lang="ts">
import Chip, { Set, LeadingIcon, TrailingIcon, Text } from '@smui/chips';
let clicked = $state(0);
</script>