aboutsummaryrefslogtreecommitdiffstats
path: root/apps/kit/src/routes/book
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-09-28 15:31:41 +0200
committerivarlovlie <git@ivarlovlie.no>2022-09-28 15:31:41 +0200
commit3a9975ce230a892a8af0286ffa81776d03a8361b (patch)
tree46df0328e95eb88144e7802819fe3e74ce9eb028 /apps/kit/src/routes/book
parent803c2ff0581e761c5175e1a04b006e1f6a997c6e (diff)
downloadgreatoffice-3a9975ce230a892a8af0286ffa81776d03a8361b.tar.xz
greatoffice-3a9975ce230a892a8af0286ffa81776d03a8361b.zip
feat: Add switch component
Diffstat (limited to 'apps/kit/src/routes/book')
-rw-r--r--apps/kit/src/routes/book/+layout.svelte6
-rw-r--r--apps/kit/src/routes/book/toggles/+page.svelte27
2 files changed, 33 insertions, 0 deletions
diff --git a/apps/kit/src/routes/book/+layout.svelte b/apps/kit/src/routes/book/+layout.svelte
index fc55d9d..02d03b6 100644
--- a/apps/kit/src/routes/book/+layout.svelte
+++ b/apps/kit/src/routes/book/+layout.svelte
@@ -17,6 +17,12 @@
class:active={$page.url.pathname.startsWith("/book/buttons")}
>Buttons</a
>
+ <a
+ href="/book/toggles"
+ class="link"
+ class:active={$page.url.pathname.startsWith("/book/toggles")}
+ >Toggles</a
+ >
</nav>
<main>
<slot />
diff --git a/apps/kit/src/routes/book/toggles/+page.svelte b/apps/kit/src/routes/book/toggles/+page.svelte
new file mode 100644
index 0000000..94228b4
--- /dev/null
+++ b/apps/kit/src/routes/book/toggles/+page.svelte
@@ -0,0 +1,27 @@
+<script>
+ import Switch from "$lib/components/switch.svelte";
+</script>
+
+<section>
+ <h2>Default</h2>
+ <Switch />
+</section>
+<section>
+ <h2>Short</h2>
+ <Switch type="short" />
+</section>
+<section>
+ <h2>Icon</h2>
+ <Switch type="icon" />
+</section>
+<section>
+ <h2>Label / Description</h2>
+ <div class="max-w-md">
+ <Switch label="Label" description="Some text" />
+ </div>
+</section>
+
+<section>
+ <h2>Label / Description (right aligned)</h2>
+ <Switch label="Label" description="Some text" rightAlignedLabelDescription />
+</section> \ No newline at end of file