Skip to content

Commit

Permalink
docs: add indeterminate demo to checkbox page
Browse files Browse the repository at this point in the history
  • Loading branch information
saadeghi committed Mar 18, 2022
1 parent ef21e94 commit 753d4ff
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/docs/src/routes/components/checkbox.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,15 @@ data="{[
`<input type="checkbox" class="$$checkbox" disabled checked>`
}</pre>
</Component>


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

0 comments on commit 753d4ff

Please sign in to comment.