Props mirror Base UI React where applicable, adapted for Svelte 5. Native HTML attributes for the rendered element are also
accepted unless noted.
ContextMenu.Root
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
open | boolean | undefined | — | Whether the component is open (controlled). |
defaultOpen | boolean | — | Whether the component is initially open (uncontrolled). |
onOpenChange | ((open: boolean, eventDetails: { reason: OpenChangeReason }) => void) | undefined | — | Event handler called when the open state changes. |
children | Snippet<[{ open: boolean }]> | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-closed | Present when the part is closed. |
data-open | Present when the part is open. |
ContextMenu.Arrow
Extends span HTML attributes.
| Property | Type | Default | Description |
|---|
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-closed | Present when the part is closed. |
data-open | Present when the part is open. |
ContextMenu.Backdrop
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
render | string | — | HTML element tag to render instead of the default host element. |
dismissible | boolean | — | — |
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-closed | Present when the part is closed. |
data-open | Present when the part is open. |
ContextMenu.CheckboxItem
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
checked | boolean | undefined | — | Controlled checked state. |
defaultChecked | boolean | — | Uncontrolled initial checked state. |
onCheckedChange | ((checked: boolean, event: Event) => void) | undefined | — | Event handler called when the checked state changes. |
disabled | boolean | false | Whether the control ignores user interaction. |
children | Snippet<[{ checked: boolean }]> | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-checked | Present when the part is checked. |
data-disabled | Present when the part is disabled. |
data-highlighted | Present when the item is highlighted. |
data-unchecked | Present when the part is unchecked. |
ContextMenu.CheckboxItemIndicator
Extends span HTML attributes.
| Property | Type | Default | Description |
|---|
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-checked | Present when the part is checked. |
data-disabled | Present when the part is disabled. |
data-unchecked | Present when the part is unchecked. |
ContextMenu.Group
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
children | Snippet | — | Content rendered inside the part. |
ContextMenu.GroupLabel
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
children | Snippet | — | Content rendered inside the part. |
ContextMenu.Item
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
disabled | boolean | false | Whether the control ignores user interaction. |
onClick | ((event: MouseEvent) => void) | undefined | — | — |
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-disabled | Present when the part is disabled. |
data-highlighted | Present when the item is highlighted. |
ContextMenu.LinkItem
Extends anchor HTML attributes.
| Property | Type | Default | Description |
|---|
disabled | boolean | false | Whether the control ignores user interaction. |
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-disabled | Present when the part is disabled. |
data-highlighted | Present when the item is highlighted. |
ContextMenu.Popup
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
render | string | — | HTML element tag to render instead of the default host element. |
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-closed | Present when the part is closed. |
data-ending-style | Present while the exit animation can run. |
data-open | Present when the part is open. |
data-starting-style | Present while the enter animation can run. |
ContextMenu.Portal
| Property | Type | Default | Description |
|---|
children | Snippet | — | Content rendered inside the part. |
ContextMenu.Positioner
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
side | Side | — | — |
align | Align | — | — |
sideOffset | number | — | — |
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-closed | Present when the part is closed. |
data-open | Present when the part is open. |
ContextMenu.RadioGroup
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
value | string | undefined | — | Controlled value. |
defaultValue | string | — | Uncontrolled initial value. |
onValueChange | ((value: string, event: Event) => void) | undefined | — | Event handler called when the value changes. |
disabled | boolean | false | Whether the control ignores user interaction. |
children | Snippet<[{ value: string }]> | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-disabled | Present when the part is disabled. |
ContextMenu.RadioItem
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
value | string | — | Controlled value. |
disabled | boolean | false | Whether the control ignores user interaction. |
children | Snippet<[{ checked: boolean }]> | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-checked | Present when the part is checked. |
data-disabled | Present when the part is disabled. |
data-highlighted | Present when the item is highlighted. |
data-unchecked | Present when the part is unchecked. |
ContextMenu.RadioItemIndicator
Extends span HTML attributes.
| Property | Type | Default | Description |
|---|
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-checked | Present when the part is checked. |
data-disabled | Present when the part is disabled. |
data-unchecked | Present when the part is unchecked. |
ContextMenu.Separator
Extends div HTML attributes.
No component-specific props — HTML attributes and children only.
ContextMenu.SubmenuRoot
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
open | boolean | undefined | — | Whether the component is open (controlled). |
defaultOpen | boolean | — | Whether the component is initially open (uncontrolled). |
onOpenChange | ((open: boolean, eventDetails: { reason: OpenChangeReason }) => void) | undefined | — | Event handler called when the open state changes. |
children | Snippet<[{ open: boolean }]> | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-closed | Present when the part is closed. |
data-open | Present when the part is open. |
ContextMenu.SubmenuTrigger
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
disabled | boolean | false | Whether the control ignores user interaction. |
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-closed | Present when the part is closed. |
data-disabled | Present when the part is disabled. |
data-highlighted | Present when the item is highlighted. |
data-open | Present when the part is open. |
ContextMenu.Trigger
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
render | string | — | HTML element tag to render instead of the default host element. |
disabled | boolean | false | Whether the control ignores user interaction. |
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-closed | Present when the part is closed. |
data-disabled | Present when the part is disabled. |
data-open | Present when the part is open. |
ContextMenu.Viewport
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
children | Snippet | — | Content rendered inside the part. |