Toggle

A two-state button that can be on or off.

Installation

npx lily-svelte@latest add toggle

Installs the style saved in lily.json. For a new Diamond project, run lily-svelte init --style diamond first.

Usage

<script lang="ts">
	import { Toggle } from '$lib/components/ui/toggle';
 
	let pressed = $state(false);
</script>
 
<Toggle bind:pressed>Bold</Toggle>

Built by levish. The source code is available on GitHub.

Quiet by design.