Skip to content

Commit 44840db

Browse files
committed
toggle group demo
1 parent 0ef8567 commit 44840db

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed
+16-5
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
<script lang="ts">
22
import { ToggleGroup } from "$lib";
3-
import { TextB, TextItalic } from "phosphor-svelte";
3+
import { TextB, TextItalic, TextStrikethrough } from "phosphor-svelte";
44
5-
let value: string[] | undefined = undefined;
5+
let value: string[] | undefined = ["bold"];
66
</script>
77

8-
<ToggleGroup.Root bind:value type="multiple">
8+
<ToggleGroup.Root
9+
bind:value
10+
type="multiple"
11+
class="flex h-input items-center gap-x-0.5 rounded-card-sm border border-muted bg-background px-[5px] py-1 shadow-mini"
12+
>
913
<ToggleGroup.Item
1014
aria-label="toggle bold"
1115
value="bold"
12-
class="inline-flex items-center justify-center rounded-[9px] bg-background transition-all sq-10 hover:bg-muted active:scale-98 data-[state=on]:bg-muted"
16+
class="inline-flex items-center justify-center rounded-[9px] bg-background transition-all sq-10 hover:bg-muted active:scale-98 data-[state=on]:bg-muted"
1317
>
1418
<TextB class="sq-6" />
1519
</ToggleGroup.Item>
1620
<ToggleGroup.Item
1721
aria-label="toggle italic"
1822
value="italic"
19-
class="inline-flex items-center justify-center rounded-[9px] bg-background transition-all sq-10 hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-foreground focus-visible:ring-offset-2 focus-visible:ring-offset-background active:scale-98 data-[state=on]:bg-muted"
23+
class="inline-flex items-center justify-center rounded-[9px] bg-background transition-all sq-10 hover:bg-muted active:scale-98 data-[state=on]:bg-muted"
2024
>
2125
<TextItalic class="sq-6" />
2226
</ToggleGroup.Item>
27+
<ToggleGroup.Item
28+
aria-label="toggle strikethrough"
29+
value="strikethrough"
30+
class="inline-flex items-center justify-center rounded-[9px] bg-background transition-all sq-10 hover:bg-muted active:scale-98 data-[state=on]:bg-muted"
31+
>
32+
<TextStrikethrough class="sq-6" />
33+
</ToggleGroup.Item>
2334
</ToggleGroup.Root>

0 commit comments

Comments
 (0)