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

<DropdownMenu.Root>
  <DropdownMenu.Trigger>
    <Button variant="ghost">Menu</Button>
  </DropdownMenu.Trigger>
  <DropdownMenu.Content>
    <DropdownMenu.Item onclick={handleEdit}>Edit</DropdownMenu.Item>
    <DropdownMenu.Item onclick={handleDelete}>Delete</DropdownMenu.Item>
  </DropdownMenu.Content>
</DropdownMenu.Root>

Import options

Root package

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

Per-component subpath

ts
import { DropdownMenu } from '@dryui/ui/dropdown-menu'

Customize

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

Structure

Compound components always start with DropdownMenu.Root. Use this structure block to understand required wrappers before you wire state or styling.

DropdownMenu.Root
  DropdownMenu.Trigger
  DropdownMenu.Content
    DropdownMenu.Item
DropdownMenu.Root DropdownMenu.TriggerDropdownMenu.ContentDropdownMenu.ItemDropdownMenu.SeparatorDropdownMenu.GroupDropdownMenu.Label

Compose

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

Compound component. Start with DropdownMenu.Root, then add only the parts you need.

DropdownMenu.TriggerDropdownMenu.ContentDropdownMenu.ItemDropdownMenu.SeparatorDropdownMenu.GroupDropdownMenu.Label

DropdownMenu.Root

Prop Type Default Required Bindable
open
boolean
false
children
Snippet

Also accepts standard HTML attributes (class, style, id, etc.)

DropdownMenu.Trigger

Prop Type Default Required Bindable
children
Snippet

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

DropdownMenu.Content

Prop Type Default Required Bindable
offset
number
children
Snippet

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

DropdownMenu.Item

Prop Type Default Required Bindable
disabled
boolean
children
Snippet

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

DropdownMenu.Separator

Prop Type Default Required Bindable

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

DropdownMenu.Group

Prop Type Default Required Bindable
children
Snippet

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

DropdownMenu.Label

Prop Type Default Required Bindable
children
Snippet

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