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 { Clipboard } from '@dryui/ui';
</script>

<Clipboard>Content</Clipboard>

Import options

Root package

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

Per-component subpath

ts
import { Clipboard } from '@dryui/ui/clipboard'

Customize

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

Copy Text

svelte
<Clipboard value="Hello, world!">
  {#snippet children({ copied, copy })}
    <Button onclick={copy} variant={copied ? 'soft' : 'outline'}>
      {copied ? 'Copied!' : 'Copy Text'}
    </Button>
  {/snippet}
</Clipboard>

Copy URL

svelte
<Clipboard value="https://dryui.dev" timeout={3000}>
  {#snippet children({ copied, copy })}
    <Button onclick={copy} variant="outline" size="sm">
      {copied ? 'URL Copied!' : 'Copy URL'}
    </Button>
  {/snippet}
</Clipboard>

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
value
string
timeout
number
children
Snippet<[{ copied: boolean; copy: () => void }]>

Forwards <div> attributes via rest props. Common examples: id, style, role. Omitted: children.