Skip to content

Commit

Permalink
docs: add indeterminate demo to toggle page
Browse files Browse the repository at this point in the history
  • Loading branch information
saadeghi committed Mar 18, 2022
1 parent f68fc08 commit ef21e94
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/docs/src/routes/components/toggle.svelte.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ published: true
import ClassTable from "@components/ClassTable.svelte"
import { prefix } from '$lib/stores';
import { replace } from '$lib/actions';
let indeterminate = true;
</script>

<ClassTable
Expand Down Expand Up @@ -128,3 +129,14 @@ data="{[
`<input type="checkbox" class="$$toggle" disabled checked>`
}</pre>
</Component>

<Component title="Indeterminate">
<input type="checkbox" class="toggle" bind:indeterminate on:click|preventDefault={()=>{}}>
<pre slot="html" use:replace={{ to: $prefix }}>{
`<!-- You can make a toggle indeterminate using JS -->
<script>
document.getElementById("my-toggle").indeterminate = true
</script>
<input type="checkbox" class="$$toggle" id="my-toggle">`
}</pre>
</Component>

0 comments on commit ef21e94

Please sign in to comment.