You've already forked AstralRinth
forked from didirus/AstralRinth
Add component API to built docs + Add Checkbox, CheckboxList, & CheckboxVirtualList
This commit is contained in:
23
src/routes/components/CheckboxVirtualList.md
Normal file
23
src/routes/components/CheckboxVirtualList.md
Normal file
@@ -0,0 +1,23 @@
|
||||
```svelte example
|
||||
<script lang="ts">
|
||||
import CheckboxVirtualList from "omorphia/components/CheckboxVirtualList.svelte";
|
||||
import IconStar from 'virtual:icons/heroicons-outline/star'
|
||||
import uniqueId from 'lodash.uniqueid'
|
||||
|
||||
let options = Array(100).fill({})
|
||||
.map(option => ({
|
||||
label: 'Star-' + uniqueId(),
|
||||
icon: IconStar,
|
||||
value: uniqueId(),
|
||||
}))
|
||||
|
||||
let selected = ['2', '6']
|
||||
</script>
|
||||
|
||||
<CheckboxVirtualList
|
||||
bind:value={selected}
|
||||
{options}
|
||||
/>
|
||||
|
||||
Selected: {selected}
|
||||
```
|
||||
Reference in New Issue
Block a user