# DarkToggle A switch component for toggling between light and dark themes. ## Usage Use standalone. (flat pass-through over `Toggle`) ```svelte ``` ## Anatomy The `class` attribute values represent part names. Other attributes represent their corresponding props. ```svelte {#if children} {children} {:else} {/if} ``` ## Props | Name | Type | Default | Description | |---|---|---|---| | `dark` | `boolean` | - | Bindable current color theme; defaults to the client's `prefers-color-scheme` setting | | `children` | `Snippet` | - | Toggle content; receives value, variant, and button element; uses DarkToggle defaults when omitted | | `left` | `Snippet` | - | Snippet rendered before the toggle, e.g. a fixed sun icon; receives value, variant, and button element | | `right` | `Snippet` | - | Snippet rendered after the toggle, e.g. a fixed moon icon; receives value, variant, and button element | | `role` | `` | `"button"` | `button` or `switch` ARIA role exposed by the underlying toggle | | `ariaLabel` | `string` | - | Accessible label for the control; defaults to DarkToggle's own label when omitted | | `attach` | `Attachment` | - | Svelte attachment on the button | | `element` | `HTMLButtonElement` | - | Bindable button element | | `styling` | `SVSClass` | - | Styling override; uses DarkToggle defaults when omitted | | `variant` | `SVSVariant` | `NEUTRAL` | Bindable variant | Other `HTMLButtonAttributes` are passed to `