Install using NPM
npm i svelte-toggle-switch
Install using YARN
yarn add svelte-toggle-switch
<script>
import Select from 'svelte-toggle-switch';
let switchValue;
let sliderValue;
let multiValue;
</script>
<Switch bind:value={switchValue} label="Enable Toggle" design="inner" />
<p>
Switch is {switchValue}
</p>
<Switch bind:value={sliderValue} label="Enable Toggle" fontSize={24} design="slider" />
<p>
Switch is {sliderValue}
</p>
<Switch bind:value={multiValue} label="Choose an Option" design="multi" options={['true', 'false']} fontSize={12}/>
<p>
Switch is {multiValue}
</p>
API | Value |
---|---|
label |
Your Text |
design |
inner , slider , multi |
fontSize |
16px |
options |
['true', 'false'] |