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

<ContextMenu.Root>
  <ContextMenu.Trigger>...</ContextMenu.Trigger>
  <ContextMenu.Content>...</ContextMenu.Content>
  <ContextMenu.Item>...</ContextMenu.Item>
  <ContextMenu.Separator>...</ContextMenu.Separator>
  <ContextMenu.Group>...</ContextMenu.Group>
  <ContextMenu.Label>...</ContextMenu.Label>
</ContextMenu.Root>

Import options

Root package

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

Per-component subpath

ts
import { ContextMenu } from '@dryui/ui/context-menu'

Customize

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

Right-Click Context Menu

Structure

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

ContextMenu.Root
  ContextMenu.Trigger
  ContextMenu.Content
  ContextMenu.Item
  ContextMenu.Separator
  ContextMenu.Group
  ContextMenu.Label
ContextMenu.Root ContextMenu.TriggerContextMenu.ContentContextMenu.ItemContextMenu.SeparatorContextMenu.GroupContextMenu.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 ContextMenu.Root, then add only the parts you need.

ContextMenu.TriggerContextMenu.ContentContextMenu.ItemContextMenu.SeparatorContextMenu.GroupContextMenu.Label

ContextMenu.Root

Prop Type Default Required Bindable
open
boolean
false
children
Snippet

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

ContextMenu.Trigger

Prop Type Default Required Bindable
children
Snippet

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

ContextMenu.Content

Prop Type Default Required Bindable
children
Snippet

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

ContextMenu.Item

Prop Type Default Required Bindable
disabled
boolean
children
Snippet

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

ContextMenu.Separator

Prop Type Default Required Bindable

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

ContextMenu.Group

Prop Type Default Required Bindable
children
Snippet

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

ContextMenu.Label

Prop Type Default Required Bindable
children
Snippet

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