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, Button } 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'

API

Props, CSS variables, and the public data attributes you can target when styling.

Prop Type Description Default Required Bindable

DropdownMenu.Root

open
boolean
Whether the overlay or disclosure is currently open. false
children
Snippet
Content rendered inside the component.

DropdownMenu.Trigger

children
Snippet
Content rendered inside the component.

DropdownMenu.Content

placement
toptop-starttop-endbottombottom-startbottom-endleftleft-startleft-endrightright-startright-end
'bottom-start'
offset
number
8
children
Snippet
Content rendered inside the component.

DropdownMenu.Item

disabled
boolean
Prevents interaction and applies disabled styling.
children
Snippet
Content rendered inside the component.

DropdownMenu.Separator

DropdownMenu.Group

children
Snippet
Content rendered inside the component.

DropdownMenu.Label

children
Snippet
Content rendered inside the component.