mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
31 lines
825 B
Svelte
31 lines
825 B
Svelte
<script lang="ts">
|
|
import { FormItem } from '.';
|
|
|
|
export let type: 'checkbox' | 'switchbox' = 'checkbox';
|
|
export let label: string;
|
|
export let showLabel = true;
|
|
export let id: string;
|
|
export let value = false;
|
|
export let required = false;
|
|
export let disabled = false;
|
|
</script>
|
|
|
|
<FormItem>
|
|
<label class="choice-item" for={id}>
|
|
<input
|
|
{id}
|
|
{disabled}
|
|
{required}
|
|
type="checkbox"
|
|
class:switch={type === 'switchbox'}
|
|
bind:checked={value} />
|
|
|
|
<div class="choice-item-content">
|
|
<div class:u-hide={!showLabel} class="choice-item-title">{label}</div>
|
|
{#if $$slots}
|
|
<p class="choice-item-paragraph"><slot /></p>
|
|
{/if}
|
|
</div>
|
|
</label>
|
|
</FormItem>
|