Theme

Start Here

Start from the smallest working snippet, then move to interactive examples and the full API contract below.

Styled quick start

Copy this entrypoint first. It includes the imports required to get the component on screen.

svelte
<script lang="ts">
  import '@dryui/ui/themes/default.css';
  import '@dryui/ui/themes/dark.css';
  import { Toggle } from '@dryui/ui';
</script>

<Toggle>Content</Toggle>

Import options

Root package

ts
import { Toggle } from '@dryui/ui'

Per-component subpath

ts
import { Toggle } from '@dryui/ui/toggle'

Customize

Use the interactive examples to see common variants, states, and composition patterns before building your own.

Default

svelte
<Toggle>Bold</Toggle>

Pressed State

svelte
<Toggle pressed>Italic</Toggle>

Variants

svelte
<Toggle variant="outline">Outline</Toggle>
<Toggle variant="ghost">Ghost</Toggle>

Sizes

svelte
<Toggle size="sm">Sm</Toggle>
<Toggle size="md">Md</Toggle>
<Toggle size="lg">Lg</Toggle>

Disabled

svelte
<Toggle disabled>Disabled</Toggle>

Interactive

svelte
<script lang="ts">
  let pressed = $state(false);
</script>
<Toggle bind:pressed>{pressed ? 'On' : 'Off'}</Toggle>

Compose

The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.

Prop Type Default Required Bindable
pressed
boolean
false
variant
outlineghost
'outline'
size
smmdlg
'md'
disabled
boolean
children
Snippet

Forwards <button> attributes via rest props. Common examples: type, disabled, name.