Skip to content
UI

Menu

A list of options that appears when a user interacts with a trigger element.

<script setup lang="ts">
import { ref } from 'vue'
import { Menu } from '@destyler-ui/vue'

const items = ref(['react', 'solid', 'vue', 'svelte'])
const checked = ref(false)
</script>

<template>
  <Menu.Root>
    <Menu.Trigger>
      Open menu
      <Menu.Indicator />
    </Menu.Trigger>
    <Menu.ContextTrigger>Open Context Menu</Menu.ContextTrigger>
    <Menu.Positioner data-testid="positioner">
      <Menu.Content>
        <Menu.Arrow>
          <Menu.ArrowTip />
        </Menu.Arrow>
        <Menu.ItemGroup>
          <Menu.ItemGroupLabel>Destyler UI</Menu.ItemGroupLabel>
          <Menu.Item value="dialog" disabled>Dialog</Menu.Item>
        </Menu.ItemGroup>
        <Menu.Separator />
        <Menu.CheckboxItem v-model:checked="checked" value="my-checkbox">
          <Menu.ItemIndicator>✅</Menu.ItemIndicator>
          <Menu.ItemText>Check me</Menu.ItemText>
        </Menu.CheckboxItem>
        <Menu.Separator />
        <Menu.RadioItemGroup>
          <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
          <Menu.RadioItem v-for="item in items" :key="item" :value="item">
            <Menu.ItemIndicator>✅</Menu.ItemIndicator>
            <Menu.ItemText>{{ item }}</Menu.ItemText>
          </Menu.RadioItem>
        </Menu.RadioItemGroup>
        <Menu.Separator />
        <Menu.Root>
          <Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
          <Menu.Positioner>
            <Menu.Content>
              <Menu.Item value="unocss">UnoCSS</Menu.Item>
              <Menu.Item value="tailwind">Tailwind</Menu.Item>
            </Menu.Content>
          </Menu.Positioner>
        </Menu.Root>
      </Menu.Content>
    </Menu.Positioner>
  </Menu.Root>
</template>
import { useState } from 'react'
import { Menu } from '@destyler-ui/react'

const items = ['react', 'solid', 'vue', 'svelte']

export function Basic() {
  const [checked, setChecked] = useState(false)

  return (
    <Menu.Root>
      <Menu.Trigger>
        Open menu
        <Menu.Indicator />
      </Menu.Trigger>
      <Menu.ContextTrigger>Open Context Menu</Menu.ContextTrigger>
      <Menu.Positioner data-testid="positioner">
        <Menu.Content>
          <Menu.Arrow>
            <Menu.ArrowTip />
          </Menu.Arrow>
          <Menu.ItemGroup>
            <Menu.ItemGroupLabel>Destyler UI</Menu.ItemGroupLabel>
            <Menu.Item value="dialog" disabled>Dialog</Menu.Item>
          </Menu.ItemGroup>
          <Menu.Separator />
          <Menu.CheckboxItem
            checked={checked}
            onCheckedChange={e => setChecked(e as boolean)}
            value="my-checkbox"
          >
            <Menu.ItemIndicator>✅</Menu.ItemIndicator>
            <Menu.ItemText>Check me</Menu.ItemText>
          </Menu.CheckboxItem>
          <Menu.Separator />
          <Menu.RadioItemGroup>
            <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
            {items.map(item => (
              <Menu.RadioItem key={item} value={item}>
                <Menu.ItemIndicator>✅</Menu.ItemIndicator>
                <Menu.ItemText>{item}</Menu.ItemText>
              </Menu.RadioItem>
            ))}
          </Menu.RadioItemGroup>
          <Menu.Separator />
          <Menu.Root>
            <Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
            <Menu.Positioner>
              <Menu.Content>
                <Menu.Item value="unocss">UnoCSS</Menu.Item>
                <Menu.Item value="tailwind">Tailwind</Menu.Item>
              </Menu.Content>
            </Menu.Positioner>
          </Menu.Root>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
import { Menu } from '@destyler-ui/solid/menu'

export function Basic() {
  return (
    <Menu.Root>
      <Menu.Trigger>
        Open menu <Menu.Indicator>➡️</Menu.Indicator>
      </Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.Item value="react">React</Menu.Item>
          <Menu.Item value="solid">Solid</Menu.Item>
          <Menu.Item value="vue">Vue</Menu.Item>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
<script lang="ts">
  import { Menu } from '@destyler-ui/svelte'
  const items = ['react', 'solid', 'vue', 'svelte']
  let checked = $state(false)
</script>

<Menu.Root>
  <Menu.Trigger>Open menu <Menu.Indicator /></Menu.Trigger>
  <Menu.ContextTrigger>Open Context Menu</Menu.ContextTrigger>
  <Menu.Positioner data-testid="positioner">
    <Menu.Content>
      <Menu.Arrow><Menu.ArrowTip /></Menu.Arrow>
      <Menu.ItemGroup><Menu.ItemGroupLabel>Destyler UI</Menu.ItemGroupLabel><Menu.Item value="dialog" disabled>Dialog</Menu.Item></Menu.ItemGroup>
      <Menu.Separator />
      <Menu.CheckboxItem bind:checked value="my-checkbox"><Menu.ItemIndicator>✅</Menu.ItemIndicator><Menu.ItemText>Check me</Menu.ItemText></Menu.CheckboxItem>
      <Menu.Separator />
      <Menu.RadioItemGroup>
        <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
        {#each items as item}<Menu.RadioItem value={item}><Menu.ItemIndicator>✅</Menu.ItemIndicator><Menu.ItemText>{item}</Menu.ItemText></Menu.RadioItem>{/each}
      </Menu.RadioItemGroup>
      <Menu.Separator />
      <Menu.Root>
        <Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
        <Menu.Positioner><Menu.Content><Menu.Item value="unocss">UnoCSS</Menu.Item><Menu.Item value="tailwind">Tailwind</Menu.Item></Menu.Content></Menu.Positioner>
      </Menu.Root>
    </Menu.Content>
  </Menu.Positioner>
</Menu.Root>
<script setup lang="ts">
import { Menu } from '@destyler-ui/vue'
</script>
<template>
<Menu.Root>
<Menu.Trigger />
<Menu.Positioner>
<Menu.Content>
<Menu.ItemGroup>
<Menu.ItemGroupLabel />
<Menu.Item>
<Menu.ItemText />
<Menu.ItemIndicator />
</Menu.Item>
</Menu.ItemGroup>
<Menu.Separator />
<Menu.CheckboxItem>
<Menu.ItemIndicator />
</Menu.CheckboxItem>
<Menu.RadioItemGroup>
<Menu.RadioItem>
<Menu.ItemIndicator />
</Menu.RadioItem>
</Menu.RadioItemGroup>
</Menu.Content>
</Menu.Positioner>
</Menu.Root>
</template>
import { Menu } from '@destyler-ui/react'
export default function Basic() {
return (
<Menu.Root>
<Menu.Trigger />
<Menu.Positioner>
<Menu.Content>
<Menu.ItemGroup>
<Menu.ItemGroupLabel />
<Menu.Item>
<Menu.ItemText />
<Menu.ItemIndicator />
</Menu.Item>
</Menu.ItemGroup>
<Menu.Separator />
<Menu.CheckboxItem>
<Menu.ItemIndicator />
</Menu.CheckboxItem>
<Menu.RadioItemGroup>
<Menu.RadioItem>
<Menu.ItemIndicator />
</Menu.RadioItem>
</Menu.RadioItemGroup>
</Menu.Content>
</Menu.Positioner>
</Menu.Root>
)
}
import { Menu } from '@destyler-ui/solid'
export default function Basic() {
return (
<Menu.Root>
<Menu.Trigger />
<Menu.Positioner>
<Menu.Content>
<Menu.ItemGroup>
<Menu.ItemGroupLabel />
<Menu.Item value="profile">
<Menu.ItemText />
<Menu.ItemIndicator />
</Menu.Item>
</Menu.ItemGroup>
<Menu.Separator />
<Menu.CheckboxItem value="notifications" checked>
<Menu.ItemIndicator />
</Menu.CheckboxItem>
<Menu.RadioItemGroup>
<Menu.RadioItem value="compact">
<Menu.ItemIndicator />
</Menu.RadioItem>
</Menu.RadioItemGroup>
</Menu.Content>
</Menu.Positioner>
</Menu.Root>
)
}
<script lang="ts">
import { Menu } from '@destyler-ui/svelte'
const items = ['react', 'solid', 'vue', 'svelte']
let checked = $state(false)
</script>
<Menu.Root>
<Menu.Trigger>Open menu <Menu.Indicator /></Menu.Trigger>
<Menu.ContextTrigger>Open Context Menu</Menu.ContextTrigger>
<Menu.Positioner data-testid="positioner">
<Menu.Content>
<Menu.Arrow><Menu.ArrowTip /></Menu.Arrow>
<Menu.ItemGroup><Menu.ItemGroupLabel>Destyler UI</Menu.ItemGroupLabel><Menu.Item value="dialog" disabled>Dialog</Menu.Item></Menu.ItemGroup>
<Menu.Separator />
<Menu.CheckboxItem bind:checked value="my-checkbox"><Menu.ItemIndicator>✅</Menu.ItemIndicator><Menu.ItemText>Check me</Menu.ItemText></Menu.CheckboxItem>
<Menu.Separator />
<Menu.RadioItemGroup>
<Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
{#each items as item}<Menu.RadioItem value={item}><Menu.ItemIndicator>✅</Menu.ItemIndicator><Menu.ItemText>{item}</Menu.ItemText></Menu.RadioItem>{/each}
</Menu.RadioItemGroup>
<Menu.Separator />
<Menu.Root>
<Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
<Menu.Positioner><Menu.Content><Menu.Item value="unocss">UnoCSS</Menu.Item><Menu.Item value="tailwind">Tailwind</Menu.Item></Menu.Content></Menu.Positioner>
</Menu.Root>
</Menu.Content>
</Menu.Positioner>
</Menu.Root>
<script setup lang="ts">
import { ref } from 'vue'
import { Menu } from '@destyler-ui/vue'

const items = ref(['react', 'solid', 'vue', 'svelte'])
const checked = ref(false)
</script>

<template>
  <Menu.Root>
    <Menu.Trigger>
      Open menu
      <Menu.Indicator />
    </Menu.Trigger>
    <Menu.ContextTrigger>Open Context Menu</Menu.ContextTrigger>
    <Menu.Positioner data-testid="positioner">
      <Menu.Content>
        <Menu.Arrow>
          <Menu.ArrowTip />
        </Menu.Arrow>
        <Menu.ItemGroup>
          <Menu.ItemGroupLabel>Destyler UI</Menu.ItemGroupLabel>
          <Menu.Item value="dialog" disabled>Dialog</Menu.Item>
        </Menu.ItemGroup>
        <Menu.Separator />
        <Menu.CheckboxItem v-model:checked="checked" value="my-checkbox">
          <Menu.ItemIndicator>✅</Menu.ItemIndicator>
          <Menu.ItemText>Check me</Menu.ItemText>
        </Menu.CheckboxItem>
        <Menu.Separator />
        <Menu.RadioItemGroup>
          <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
          <Menu.RadioItem v-for="item in items" :key="item" :value="item">
            <Menu.ItemIndicator>✅</Menu.ItemIndicator>
            <Menu.ItemText>{{ item }}</Menu.ItemText>
          </Menu.RadioItem>
        </Menu.RadioItemGroup>
        <Menu.Separator />
        <Menu.Root>
          <Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
          <Menu.Positioner>
            <Menu.Content>
              <Menu.Item value="unocss">UnoCSS</Menu.Item>
              <Menu.Item value="tailwind">Tailwind</Menu.Item>
            </Menu.Content>
          </Menu.Positioner>
        </Menu.Root>
      </Menu.Content>
    </Menu.Positioner>
  </Menu.Root>
</template>
import { useState } from 'react'
import { Menu } from '@destyler-ui/react'

const items = ['react', 'solid', 'vue', 'svelte']

export function Basic() {
  const [checked, setChecked] = useState(false)

  return (
    <Menu.Root>
      <Menu.Trigger>
        Open menu
        <Menu.Indicator />
      </Menu.Trigger>
      <Menu.ContextTrigger>Open Context Menu</Menu.ContextTrigger>
      <Menu.Positioner data-testid="positioner">
        <Menu.Content>
          <Menu.Arrow>
            <Menu.ArrowTip />
          </Menu.Arrow>
          <Menu.ItemGroup>
            <Menu.ItemGroupLabel>Destyler UI</Menu.ItemGroupLabel>
            <Menu.Item value="dialog" disabled>Dialog</Menu.Item>
          </Menu.ItemGroup>
          <Menu.Separator />
          <Menu.CheckboxItem
            checked={checked}
            onCheckedChange={e => setChecked(e as boolean)}
            value="my-checkbox"
          >
            <Menu.ItemIndicator>✅</Menu.ItemIndicator>
            <Menu.ItemText>Check me</Menu.ItemText>
          </Menu.CheckboxItem>
          <Menu.Separator />
          <Menu.RadioItemGroup>
            <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
            {items.map(item => (
              <Menu.RadioItem key={item} value={item}>
                <Menu.ItemIndicator>✅</Menu.ItemIndicator>
                <Menu.ItemText>{item}</Menu.ItemText>
              </Menu.RadioItem>
            ))}
          </Menu.RadioItemGroup>
          <Menu.Separator />
          <Menu.Root>
            <Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
            <Menu.Positioner>
              <Menu.Content>
                <Menu.Item value="unocss">UnoCSS</Menu.Item>
                <Menu.Item value="tailwind">Tailwind</Menu.Item>
              </Menu.Content>
            </Menu.Positioner>
          </Menu.Root>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
import { Menu } from '@destyler-ui/solid/menu'

export function Basic() {
  return (
    <Menu.Root>
      <Menu.Trigger>
        Open menu <Menu.Indicator>➡️</Menu.Indicator>
      </Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.Item value="react">React</Menu.Item>
          <Menu.Item value="solid">Solid</Menu.Item>
          <Menu.Item value="vue">Vue</Menu.Item>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
<script lang="ts">
  import { Menu } from '@destyler-ui/svelte'
  const items = ['react', 'solid', 'vue', 'svelte']
  let checked = $state(false)
</script>

<Menu.Root>
  <Menu.Trigger>Open menu <Menu.Indicator /></Menu.Trigger>
  <Menu.ContextTrigger>Open Context Menu</Menu.ContextTrigger>
  <Menu.Positioner data-testid="positioner">
    <Menu.Content>
      <Menu.Arrow><Menu.ArrowTip /></Menu.Arrow>
      <Menu.ItemGroup><Menu.ItemGroupLabel>Destyler UI</Menu.ItemGroupLabel><Menu.Item value="dialog" disabled>Dialog</Menu.Item></Menu.ItemGroup>
      <Menu.Separator />
      <Menu.CheckboxItem bind:checked value="my-checkbox"><Menu.ItemIndicator>✅</Menu.ItemIndicator><Menu.ItemText>Check me</Menu.ItemText></Menu.CheckboxItem>
      <Menu.Separator />
      <Menu.RadioItemGroup>
        <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
        {#each items as item}<Menu.RadioItem value={item}><Menu.ItemIndicator>✅</Menu.ItemIndicator><Menu.ItemText>{item}</Menu.ItemText></Menu.RadioItem>{/each}
      </Menu.RadioItemGroup>
      <Menu.Separator />
      <Menu.Root>
        <Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
        <Menu.Positioner><Menu.Content><Menu.Item value="unocss">UnoCSS</Menu.Item><Menu.Item value="tailwind">Tailwind</Menu.Item></Menu.Content></Menu.Positioner>
      </Menu.Root>
    </Menu.Content>
  </Menu.Positioner>
</Menu.Root>

Use a context menu triggered by right-click.

<script setup lang="ts">
import { Menu } from '@destyler-ui/vue'
</script>

<template>
  <Menu.Root>
    <Menu.ContextTrigger>Right click me</Menu.ContextTrigger>
    <Menu.Positioner>
      <Menu.Content>
        <Menu.Item value="react">React</Menu.Item>
        <Menu.Item value="solid">Solid</Menu.Item>
        <Menu.Item value="vue">Vue</Menu.Item>
      </Menu.Content>
    </Menu.Positioner>
  </Menu.Root>
</template>
import { Menu } from '@destyler-ui/react'

export function Context() {
  return (
    <Menu.Root>
      <Menu.ContextTrigger>Right click me</Menu.ContextTrigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.Item value="react">React</Menu.Item>
          <Menu.Item value="solid">Solid</Menu.Item>
          <Menu.Item value="vue">Vue</Menu.Item>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
import { Menu } from '@destyler-ui/solid/menu'

export function Context() {
  return (
    <Menu.Root>
      <Menu.ContextTrigger>Right click me</Menu.ContextTrigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.Item value="react">React</Menu.Item>
          <Menu.Item value="solid">Solid</Menu.Item>
          <Menu.Item value="vue">Vue</Menu.Item>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
<script lang="ts">import { Menu } from '@destyler-ui/svelte'</script>
<Menu.Root><Menu.ContextTrigger>Right click me</Menu.ContextTrigger><Menu.Positioner><Menu.Content>
  <Menu.Item value="react">React</Menu.Item><Menu.Item value="solid">Solid</Menu.Item><Menu.Item value="vue">Vue</Menu.Item>
</Menu.Content></Menu.Positioner></Menu.Root>

Control the open state of the menu programmatically.

<script setup lang="ts">
import type { InteractOutsideEvent } from '@destyler/menu'
import { Menu } from '@destyler-ui/vue'
import { ref } from 'vue'

const isOpen = ref(false)
const externalTrigger = ref<HTMLButtonElement | null>(null)

function handleInteractOutside(event: InteractOutsideEvent) {
  const target = event.detail.originalEvent.target
  // The external button owns this toggle. Dismissing on its pointerdown or
  // focus would set false before click toggles the value back to true.
  if (target instanceof Node && externalTrigger.value?.contains(target))
    event.preventDefault()
}
</script>

<template>
  <button ref="externalTrigger" @click="isOpen = !isOpen">Trigger from the outside</button>
  <Menu.Root v-model:open="isOpen" @interact-outside="handleInteractOutside">
    <Menu.Trigger>Open menu</Menu.Trigger>
    <Menu.Positioner>
      <Menu.Content>
        <Menu.Item value="react">React</Menu.Item>
        <Menu.Item value="solid">Solid</Menu.Item>
        <Menu.Item value="vue">Vue</Menu.Item>
      </Menu.Content>
    </Menu.Positioner>
  </Menu.Root>
</template>
import { useState } from 'react'
import { Menu } from '@destyler-ui/react'

export function Controlled() {
  const [isOpen, setIsOpen] = useState(false)

  return (
    <>
      <button onClick={() => setIsOpen(!isOpen)}>Trigger from the outside</button>
      <Menu.Root open={isOpen} onOpenChange={({ open }) => setIsOpen(open)}>
        <Menu.Trigger>Open menu</Menu.Trigger>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.Item value="react">React</Menu.Item>
            <Menu.Item value="solid">Solid</Menu.Item>
            <Menu.Item value="vue">Vue</Menu.Item>
          </Menu.Content>
        </Menu.Positioner>
      </Menu.Root>
    </>
  )
}
import { Menu } from '@destyler-ui/solid/menu'
import { createSignal } from 'solid-js'

export function Controlled() {
  const [isOpen, setIsOpen] = createSignal(false)

  return (
    <>
      <button type="button" onClick={() => setIsOpen(!isOpen())}>
        Trigger from the outside
      </button>
      <Menu.Root
        open={isOpen()}
        onOpenChange={({ open }) => setIsOpen(open)}
        onSelect={id => console.warn(id)}
      >
        <Menu.Trigger>
          Open menu <Menu.Indicator>➡️</Menu.Indicator>
        </Menu.Trigger>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.Item value="react">React</Menu.Item>
            <Menu.Item value="solid">Solid</Menu.Item>
            <Menu.Item value="vue">Vue</Menu.Item>
          </Menu.Content>
        </Menu.Positioner>
      </Menu.Root>
    </>
  )
}
<script lang="ts">
  import { Menu } from '@destyler-ui/svelte'
  let open = $state(false)
</script>
<button type="button" onclick={() => open = !open}>Trigger from the outside</button>
<Menu.Root bind:open><Menu.Trigger>Open menu</Menu.Trigger><Menu.Positioner><Menu.Content>
  <Menu.Item value="react">React</Menu.Item><Menu.Item value="solid">Solid</Menu.Item><Menu.Item value="vue">Vue</Menu.Item>
</Menu.Content></Menu.Positioner></Menu.Root>

Open the menu by default with defaultOpen.

<script setup lang="ts">
import { ref } from 'vue'
import { Menu } from '@destyler-ui/vue'

const items = ref(['react', 'solid', 'vue', 'svelte'])
const checked = ref(false)
</script>

<template>
 <Menu.Root default-open>
    <Menu.Trigger>
      Open menu
      <Menu.Indicator />
    </Menu.Trigger>
    <Menu.ContextTrigger>Open Context Menu</Menu.ContextTrigger>
    <Menu.Positioner data-testid="positioner">
      <Menu.Content>
        <Menu.Arrow>
          <Menu.ArrowTip />
        </Menu.Arrow>
        <Menu.ItemGroup>
          <Menu.ItemGroupLabel>Destyler UI</Menu.ItemGroupLabel>
          <Menu.Item value="dialog" disabled>Dialog</Menu.Item>
        </Menu.ItemGroup>
        <Menu.Separator />
        <Menu.CheckboxItem v-model:checked="checked" value="my-checkbox">
          <Menu.ItemIndicator>✅</Menu.ItemIndicator>
          <Menu.ItemText>Check me</Menu.ItemText>
        </Menu.CheckboxItem>
        <Menu.Separator />
        <Menu.RadioItemGroup>
          <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
          <Menu.RadioItem v-for="item in items" :key="item" :value="item">
            <Menu.ItemIndicator>✅</Menu.ItemIndicator>
            <Menu.ItemText>{{ item }}</Menu.ItemText>
          </Menu.RadioItem>
        </Menu.RadioItemGroup>
        <Menu.Separator />
        <Menu.Root>
          <Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
          <Menu.Positioner>
            <Menu.Content>
              <Menu.Item value="unocss">UnoCSS</Menu.Item>
              <Menu.Item value="tailwind">Tailwind</Menu.Item>
            </Menu.Content>
          </Menu.Positioner>
        </Menu.Root>
      </Menu.Content>
    </Menu.Positioner>
  </Menu.Root>
</template>
import { useState } from 'react'
import { Menu } from '@destyler-ui/react'

const items = ['react', 'solid', 'vue', 'svelte']

export function InitialOpen() {
  const [checked, setChecked] = useState(false)

  return (
    <Menu.Root defaultOpen>
      <Menu.Trigger>
        Open menu
        <Menu.Indicator />
      </Menu.Trigger>
      <Menu.ContextTrigger>Open Context Menu</Menu.ContextTrigger>
      <Menu.Positioner data-testid="positioner">
        <Menu.Content>
          <Menu.Arrow>
            <Menu.ArrowTip />
          </Menu.Arrow>
          <Menu.ItemGroup>
            <Menu.ItemGroupLabel>Destyler UI</Menu.ItemGroupLabel>
            <Menu.Item value="dialog" disabled>Dialog</Menu.Item>
          </Menu.ItemGroup>
          <Menu.Separator />
          <Menu.CheckboxItem
            checked={checked}
            onCheckedChange={e => setChecked(e as boolean)}
            value="my-checkbox"
          >
            <Menu.ItemIndicator>✅</Menu.ItemIndicator>
            <Menu.ItemText>Check me</Menu.ItemText>
          </Menu.CheckboxItem>
          <Menu.Separator />
          <Menu.RadioItemGroup>
            <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
            {items.map(item => (
              <Menu.RadioItem key={item} value={item}>
                <Menu.ItemIndicator>✅</Menu.ItemIndicator>
                <Menu.ItemText>{item}</Menu.ItemText>
              </Menu.RadioItem>
            ))}
          </Menu.RadioItemGroup>
          <Menu.Separator />
          <Menu.Root>
            <Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
            <Menu.Positioner>
              <Menu.Content>
                <Menu.Item value="unocss">UnoCSS</Menu.Item>
                <Menu.Item value="tailwind">Tailwind</Menu.Item>
              </Menu.Content>
            </Menu.Positioner>
          </Menu.Root>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
import { Menu } from '@destyler-ui/solid/menu'

export function InitialOpen() {
  return (
    <Menu.Root defaultOpen>
      <Menu.Trigger>
        Open menu <Menu.Indicator>➡️</Menu.Indicator>
      </Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.Item value="react">React</Menu.Item>
          <Menu.Item value="solid">Solid</Menu.Item>
          <Menu.Item value="vue">Vue</Menu.Item>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
<script lang="ts">
  import { Menu } from '@destyler-ui/svelte'
  const items = ['react', 'solid', 'vue', 'svelte']
  let checked = $state(false)
</script>

<Menu.Root defaultOpen>
  <Menu.Trigger>Open menu <Menu.Indicator /></Menu.Trigger>
  <Menu.ContextTrigger>Open Context Menu</Menu.ContextTrigger>
  <Menu.Positioner data-testid="positioner">
    <Menu.Content>
      <Menu.Arrow><Menu.ArrowTip /></Menu.Arrow>
      <Menu.ItemGroup><Menu.ItemGroupLabel>Destyler UI</Menu.ItemGroupLabel><Menu.Item value="dialog" disabled>Dialog</Menu.Item></Menu.ItemGroup>
      <Menu.Separator />
      <Menu.CheckboxItem bind:checked value="my-checkbox"><Menu.ItemIndicator>✅</Menu.ItemIndicator><Menu.ItemText>Check me</Menu.ItemText></Menu.CheckboxItem>
      <Menu.Separator />
      <Menu.RadioItemGroup>
        <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
        {#each items as item}<Menu.RadioItem value={item}><Menu.ItemIndicator>✅</Menu.ItemIndicator><Menu.ItemText>{item}</Menu.ItemText></Menu.RadioItem>{/each}
      </Menu.RadioItemGroup>
      <Menu.Separator />
      <Menu.Root>
        <Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
        <Menu.Positioner><Menu.Content><Menu.Item value="unocss">UnoCSS</Menu.Item><Menu.Item value="tailwind">Tailwind</Menu.Item></Menu.Content></Menu.Positioner>
      </Menu.Root>
    </Menu.Content>
  </Menu.Positioner>
</Menu.Root>

Create nested submenus.

<script setup lang="ts">
import { Menu } from '@destyler-ui/vue'
</script>

<template>
  <Menu.Root>
    <Menu.Trigger>Open menu</Menu.Trigger>
    <Menu.Positioner>
      <Menu.Content>
        <Menu.Root>
          <Menu.TriggerItem>JS Frameworks</Menu.TriggerItem>
          <Menu.Positioner>
            <Menu.Content>
              <Menu.Item value="react">React</Menu.Item>
              <Menu.Item value="solid">Solid</Menu.Item>
              <Menu.Item value="vue">Vue</Menu.Item>
            </Menu.Content>
          </Menu.Positioner>
        </Menu.Root>
        <Menu.Root>
          <Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
          <Menu.Positioner>
            <Menu.Content>
              <Menu.Item value="unocss">UnoCSS</Menu.Item>
              <Menu.Item value="tailwind">Tailwind</Menu.Item>
            </Menu.Content>
          </Menu.Positioner>
        </Menu.Root>
      </Menu.Content>
    </Menu.Positioner>
  </Menu.Root>
</template>
import { Menu } from '@destyler-ui/react'

export function Nested() {
  return (
    <Menu.Root>
      <Menu.Trigger>Open menu</Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.Root>
            <Menu.TriggerItem>JS Frameworks</Menu.TriggerItem>
            <Menu.Positioner>
              <Menu.Content>
                <Menu.Item value="react">React</Menu.Item>
                <Menu.Item value="solid">Solid</Menu.Item>
                <Menu.Item value="vue">Vue</Menu.Item>
              </Menu.Content>
            </Menu.Positioner>
          </Menu.Root>
          <Menu.Root>
            <Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
            <Menu.Positioner>
              <Menu.Content>
                <Menu.Item value="unocss">UnoCSS</Menu.Item>
                <Menu.Item value="tailwind">Tailwind</Menu.Item>
              </Menu.Content>
            </Menu.Positioner>
          </Menu.Root>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
import { Menu } from '@destyler-ui/solid/menu'
import { Portal } from 'solid-js/web'

export function Nested() {
  return (
    <Menu.Root>
      <Menu.Trigger>Open menu</Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.Root>
            <Menu.TriggerItem>JS Frameworks</Menu.TriggerItem>
            <Portal>
              <Menu.Positioner>
                <Menu.Content>
                  <Menu.Item value="react">React</Menu.Item>
                  <Menu.Item value="solid">Solid</Menu.Item>
                  <Menu.Item value="vue">Vue</Menu.Item>
                </Menu.Content>
              </Menu.Positioner>
            </Portal>
          </Menu.Root>
          <Menu.Root>
            <Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem>
            <Portal>
              <Menu.Positioner>
                <Menu.Content>
                  <Menu.Item value="panda">Panda</Menu.Item>
                  <Menu.Item value="tailwind">Tailwind</Menu.Item>
                </Menu.Content>
              </Menu.Positioner>
            </Portal>
          </Menu.Root>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
<script lang="ts">import { Menu } from '@destyler-ui/svelte'</script>
<Menu.Root><Menu.Trigger>Open menu</Menu.Trigger><Menu.Positioner><Menu.Content>
  <Menu.Root><Menu.TriggerItem>JS Frameworks</Menu.TriggerItem><Menu.Positioner><Menu.Content><Menu.Item value="react">React</Menu.Item><Menu.Item value="solid">Solid</Menu.Item><Menu.Item value="vue">Vue</Menu.Item></Menu.Content></Menu.Positioner></Menu.Root>
  <Menu.Root><Menu.TriggerItem>CSS Frameworks</Menu.TriggerItem><Menu.Positioner><Menu.Content><Menu.Item value="unocss">UnoCSS</Menu.Item><Menu.Item value="tailwind">Tailwind</Menu.Item></Menu.Content></Menu.Positioner></Menu.Root>
</Menu.Content></Menu.Positioner></Menu.Root>

Group menu items together.

<script setup lang="ts">
import { Menu } from '@destyler-ui/vue'
</script>

<template>
  <Menu.Root>
    <Menu.Trigger>Open menu</Menu.Trigger>
    <Menu.Positioner>
      <Menu.Content>
        <Menu.ItemGroup>
          <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
          <Menu.Item value="react">React</Menu.Item>
          <Menu.Item value="solid">Solid</Menu.Item>
          <Menu.Item value="vue">Vue</Menu.Item>
        </Menu.ItemGroup>
        <Menu.ItemGroup>
          <Menu.ItemGroupLabel>CSS Frameworks</Menu.ItemGroupLabel>
          <Menu.Item value="unocss">UnoCSS</Menu.Item>
          <Menu.Item value="tailwind">Tailwind</Menu.Item>
        </Menu.ItemGroup>
      </Menu.Content>
    </Menu.Positioner>
  </Menu.Root>
</template>
import { Menu } from '@destyler-ui/react'

export function Group() {
  return (
    <Menu.Root>
      <Menu.Trigger>Open menu</Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.ItemGroup>
            <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
            <Menu.Item value="react">React</Menu.Item>
            <Menu.Item value="solid">Solid</Menu.Item>
            <Menu.Item value="vue">Vue</Menu.Item>
          </Menu.ItemGroup>
          <Menu.ItemGroup>
            <Menu.ItemGroupLabel>CSS Frameworks</Menu.ItemGroupLabel>
            <Menu.Item value="unocss">UnoCSS</Menu.Item>
            <Menu.Item value="tailwind">Tailwind</Menu.Item>
          </Menu.ItemGroup>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
import { Menu } from '@destyler-ui/solid/menu'

export function Group() {
  return (
    <Menu.Root>
      <Menu.Trigger>Open menu</Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.ItemGroup>
            <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
            <Menu.Item value="react">React</Menu.Item>
            <Menu.Item value="solid">Solid</Menu.Item>
            <Menu.Item value="vue">Vue</Menu.Item>
          </Menu.ItemGroup>
          <Menu.ItemGroup>
            <Menu.ItemGroupLabel>CSS Frameworks</Menu.ItemGroupLabel>
            <Menu.Item value="panda">Panda</Menu.Item>
            <Menu.Item value="tailwind">Tailwind</Menu.Item>
          </Menu.ItemGroup>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
<script lang="ts">import { Menu } from '@destyler-ui/svelte'</script>
<Menu.Root><Menu.Trigger>Open menu</Menu.Trigger><Menu.Positioner><Menu.Content>
  <Menu.ItemGroup><Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel><Menu.Item value="react">React</Menu.Item><Menu.Item value="solid">Solid</Menu.Item><Menu.Item value="vue">Vue</Menu.Item></Menu.ItemGroup>
  <Menu.ItemGroup><Menu.ItemGroupLabel>CSS Frameworks</Menu.ItemGroupLabel><Menu.Item value="unocss">UnoCSS</Menu.Item><Menu.Item value="tailwind">Tailwind</Menu.Item></Menu.ItemGroup>
</Menu.Content></Menu.Positioner></Menu.Root>

Use checkbox items in the menu.

<script setup lang="ts">
import { Menu } from '@destyler-ui/vue'
import { ref } from 'vue'

const checked = ref(true)
</script>

<template>
  <Menu.Root>
    <Menu.Trigger>Open menu</Menu.Trigger>
    <Menu.Positioner>
      <Menu.Content>
        <Menu.CheckboxItem v-model:checked="checked" value="my-checkbox">
          <Menu.ItemIndicator>✅</Menu.ItemIndicator>
          <Menu.ItemText>Check me</Menu.ItemText>
        </Menu.CheckboxItem>
      </Menu.Content>
    </Menu.Positioner>
  </Menu.Root>
</template>
import { useState } from 'react'
import { Menu } from '@destyler-ui/react'

export function Checkbox() {
  const [checked, setChecked] = useState(true)

  return (
    <Menu.Root>
      <Menu.Trigger>Open menu</Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.CheckboxItem
            checked={checked}
            onCheckedChange={e => setChecked(e as boolean)}
            value="my-checkbox"
          >
            <Menu.ItemIndicator>✅</Menu.ItemIndicator>
            <Menu.ItemText>Check me</Menu.ItemText>
          </Menu.CheckboxItem>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
import { Menu } from '@destyler-ui/solid/menu'
import { createSignal } from 'solid-js'

export function Checkbox() {
  const [checked, setChecked] = createSignal(true)

  return (
    <Menu.Root>
      <Menu.Trigger>Open menu</Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.CheckboxItem checked={checked()} onCheckedChange={setChecked} value="checked">
            <Menu.ItemIndicator>✅</Menu.ItemIndicator>
            <Menu.ItemText>Check me</Menu.ItemText>
          </Menu.CheckboxItem>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
<script lang="ts">
  import { Menu } from '@destyler-ui/svelte'
  let checked = $state(true)
</script>
<Menu.Root><Menu.Trigger>Open menu</Menu.Trigger><Menu.Positioner><Menu.Content>
  <Menu.CheckboxItem bind:checked value="my-checkbox"><Menu.ItemIndicator>✅</Menu.ItemIndicator><Menu.ItemText>Check me</Menu.ItemText></Menu.CheckboxItem>
</Menu.Content></Menu.Positioner></Menu.Root>

Use radio items in the menu for single selection.

<script setup lang="ts">
import { Menu } from '@destyler-ui/vue'
import { ref } from 'vue'

const value = ref('React')
const items = ref(['React', 'Solid', 'Vue'])
</script>

<template>
  <Menu.Root>
    <Menu.Trigger>Open menu</Menu.Trigger>
    <Menu.Positioner>
      <Menu.Content>
        <Menu.RadioItemGroup v-model="value">
          <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
          <Menu.RadioItem v-for="item in items" :key="item" :value="item">
            <Menu.ItemIndicator>✅</Menu.ItemIndicator>
            <Menu.ItemText>{{ item }}</Menu.ItemText>
          </Menu.RadioItem>
        </Menu.RadioItemGroup>
      </Menu.Content>
    </Menu.Positioner>
  </Menu.Root>
</template>
import { useState } from 'react'
import { Menu } from '@destyler-ui/react'

const items = ['React', 'Solid', 'Vue']

export function RadioGroup() {
  const [value, setValue] = useState('React')

  return (
    <Menu.Root>
      <Menu.Trigger>Open menu</Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.RadioItemGroup value={value} onValueChange={({ value }) => setValue(value)}>
            <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
            {items.map(item => (
              <Menu.RadioItem key={item} value={item}>
                <Menu.ItemIndicator>✅</Menu.ItemIndicator>
                <Menu.ItemText>{item}</Menu.ItemText>
              </Menu.RadioItem>
            ))}
          </Menu.RadioItemGroup>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
import { createSignal, For } from 'solid-js'
import { Menu } from '@destyler-ui/solid'

const items = ['React', 'Solid', 'Vue']

export function RadioGroup() {
  const [value, setValue] = createSignal('React')

  return (
    <Menu.Root>
      <Menu.Trigger>Open menu</Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.RadioItemGroup
            value={value()}
            onValueChange={({ value }) => setValue(value)}
          >
            <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
            <For each={items}>
              {item => (
                <Menu.RadioItem value={item}>
                  <Menu.ItemIndicator>✅</Menu.ItemIndicator>
                  <Menu.ItemText>{item}</Menu.ItemText>
                </Menu.RadioItem>
              )}
            </For>
          </Menu.RadioItemGroup>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
<script lang="ts">
  import { Menu } from '@destyler-ui/svelte'
  const items = ['React', 'Solid', 'Vue']
  let value = $state('React')
</script>
<Menu.Root><Menu.Trigger>Open menu</Menu.Trigger><Menu.Positioner><Menu.Content><Menu.RadioItemGroup bind:value>
  <Menu.ItemGroupLabel>JS Frameworks</Menu.ItemGroupLabel>
  {#each items as item}<Menu.RadioItem value={item}><Menu.ItemIndicator>✅</Menu.ItemIndicator><Menu.ItemText>{item}</Menu.ItemText></Menu.RadioItem>{/each}
</Menu.RadioItemGroup></Menu.Content></Menu.Positioner></Menu.Root>

Add visual separators between menu items.

<script setup lang="ts">
import { Menu } from '@destyler-ui/vue'
</script>

<template>
  <Menu.Root>
    <Menu.Trigger>Open menu</Menu.Trigger>
    <Menu.Positioner>
      <Menu.Content>
        <Menu.Item value="react">React</Menu.Item>
        <Menu.Item value="solid">Solid</Menu.Item>
        <Menu.Separator />
        <Menu.Item value="vue">Vue</Menu.Item>
      </Menu.Content>
    </Menu.Positioner>
  </Menu.Root>
</template>
import { Menu } from '@destyler-ui/react'

export function Separator() {
  return (
    <Menu.Root>
      <Menu.Trigger>Open menu</Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.Item value="react">React</Menu.Item>
          <Menu.Item value="solid">Solid</Menu.Item>
          <Menu.Separator />
          <Menu.Item value="vue">Vue</Menu.Item>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
import { Menu } from '@destyler-ui/solid/menu'

export function Separator() {
  return (
    <Menu.Root>
      <Menu.Trigger>Open menu</Menu.Trigger>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.Item value="react">React</Menu.Item>
          <Menu.Item value="solid">Solid</Menu.Item>
          <Menu.Separator />
          <Menu.Item value="vue">Vue</Menu.Item>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
<script lang="ts">import { Menu } from '@destyler-ui/svelte'</script>
<Menu.Root><Menu.Trigger>Open menu</Menu.Trigger><Menu.Positioner><Menu.Content>
  <Menu.Item value="react">React</Menu.Item><Menu.Item value="solid">Solid</Menu.Item><Menu.Separator /><Menu.Item value="vue">Vue</Menu.Item>
</Menu.Content></Menu.Positioner></Menu.Root>

Use render prop for custom menu item rendering.

<script setup lang="ts">
import { Menu } from '@destyler-ui/vue'
</script>

<template>
  <Menu.Root>
    <Menu.Context v-slot="menu">
      <Menu.Trigger>Menu is {{ menu.open ? 'open' : 'closed' }}</Menu.Trigger>
    </Menu.Context>
    <Menu.Positioner>
      <Menu.Content>
        <Menu.Item value="react">
          <Menu.ItemContext v-slot="item">
            React is {{ item.highlighted ? 'highlighted' : 'not highlighted' }}
          </Menu.ItemContext>
        </Menu.Item>
        <Menu.Item value="solid">Solid</Menu.Item>
        <Menu.Item value="vue">Vue</Menu.Item>
      </Menu.Content>
    </Menu.Positioner>
  </Menu.Root>
</template>
import { Menu } from '@destyler-ui/react'

export function RenderProp() {
  return (
    <Menu.Root>
      <Menu.Context>
        {menu => (
          <Menu.Trigger>Menu is {menu.open ? 'open' : 'closed'}</Menu.Trigger>
        )}
      </Menu.Context>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.Item value="react">
            <Menu.ItemContext>
              {item => `React is ${item.highlighted ? 'highlighted' : 'not highlighted'}`}
            </Menu.ItemContext>
          </Menu.Item>
          <Menu.Item value="solid">Solid</Menu.Item>
          <Menu.Item value="vue">Vue</Menu.Item>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
import { Menu } from '@destyler-ui/solid/menu'

export function RenderProp() {
  return (
    <Menu.Root>
      <Menu.Context>
        {context => <Menu.Trigger>Menu is {context().open ? 'open' : 'closed'}</Menu.Trigger>}
      </Menu.Context>
      <Menu.Positioner>
        <Menu.Content>
          <Menu.Item value="react">React</Menu.Item>
          <Menu.Item value="solid">
            <Menu.ItemContext>
              {context => <>Solid is {context().highlighted ? 'highlighted' : 'not highlighted'}</>}
            </Menu.ItemContext>
          </Menu.Item>
          <Menu.Item value="vue">Vue</Menu.Item>
        </Menu.Content>
      </Menu.Positioner>
    </Menu.Root>
  )
}
<script lang="ts">import { Menu } from '@destyler-ui/svelte'</script>
<Menu.Root>
  <Menu.Context>{#snippet render(menu)}<Menu.Trigger>Menu is {menu().open ? 'open' : 'closed'}</Menu.Trigger>{/snippet}</Menu.Context>
  <Menu.Positioner><Menu.Content>
    <Menu.Item value="react"><Menu.ItemContext>{#snippet render(item)}React is {item().highlighted ? 'highlighted' : 'not highlighted'}{/snippet}</Menu.ItemContext></Menu.Item>
    <Menu.Item value="solid">Solid</Menu.Item><Menu.Item value="vue">Vue</Menu.Item>
  </Menu.Content></Menu.Positioner>
</Menu.Root>
<script setup lang="ts">
import { Menu, useMenu } from '@destyler-ui/vue'

const menu = useMenu()
</script>

<template>
  <button @click="menu.api.value.setHighlightedValue('solid')">Highlight Solid</button>

  <Menu.RootProvider :value="menu">
    <Menu.Trigger>
      Open menu
      <Menu.Indicator />
    </Menu.Trigger>
    <Menu.Positioner>
      <Menu.Content>
        <Menu.Item value="react">React</Menu.Item>
        <Menu.Item value="solid">Solid</Menu.Item>
        <Menu.Item value="vue">Vue</Menu.Item>
      </Menu.Content>
    </Menu.Positioner>
  </Menu.RootProvider>
</template>
import { Menu, useMenu } from '@destyler-ui/react'

export function RootProvider() {
  const menu = useMenu()

  return (
    <>
      <button onClick={() => menu.api.setHighlightedValue('solid')}>Highlight Solid</button>

      <Menu.RootProvider value={menu}>
        <Menu.Trigger>
          Open menu
          <Menu.Indicator />
        </Menu.Trigger>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.Item value="react">React</Menu.Item>
            <Menu.Item value="solid">Solid</Menu.Item>
            <Menu.Item value="vue">Vue</Menu.Item>
          </Menu.Content>
        </Menu.Positioner>
      </Menu.RootProvider>
    </>
  )
}
import { Menu, useMenu } from '@destyler-ui/solid/menu'

export function RootProvider() {
  const menu = useMenu()

  return (
    <>
      <button onClick={() => menu.api().setHighlightedValue('solid')}>Highlight Solid</button>

      <Menu.Root>
        <Menu.Trigger>
          Open menu <Menu.Indicator>➡️</Menu.Indicator>
        </Menu.Trigger>
        <Menu.Positioner>
          <Menu.Content>
            <Menu.Item value="react">React</Menu.Item>
            <Menu.Item value="solid">Solid</Menu.Item>
            <Menu.Item value="vue">Vue</Menu.Item>
          </Menu.Content>
        </Menu.Positioner>
      </Menu.Root>
    </>
  )
}
<script lang="ts">
  import { Menu, useMenu } from '@destyler-ui/svelte'
  const id = $props.id()
  const menu = useMenu({ id })
</script>
<button type="button" onclick={() => menu().api.setHighlightedValue('solid')}>Highlight Solid</button>
<Menu.RootProvider value={menu}><Menu.Trigger>Open menu <Menu.Indicator /></Menu.Trigger><Menu.Positioner><Menu.Content>
  <Menu.Item value="react">React</Menu.Item><Menu.Item value="solid">Solid</Menu.Item><Menu.Item value="vue">Vue</Menu.Item>
</Menu.Content></Menu.Positioner></Menu.RootProvider>
PropDefaultType
anchorPoint—menu.Point

The positioning point for the menu. Can be set by the context menu trigger or the button trigger.

aria-label—string

The accessibility label for the menu

asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

closeOnSelecttruefalse | true

Whether to close the menu when an option is selected

compositetruefalse | true

Whether the menu is a composed with other composite widgets like a combobox or tabs

defaultOpen—false | true

The initial open state of the menu when it is first rendered. Use when you do not need to control its open state.

highlightedValue—string

The value of the highlighted menu item.

id—string

The unique identifier of the machine.

ids—Partial<{ trigger: string; contextTrigger: string; content: string; groupLabel: (id: string) => string; group: (id: string) => string; positioner: string; arrow: string; }>

The ids of the elements in the menu. Useful for composition.

lazyMountfalsefalse | true

Whether to enable lazy mounting

loopFocusfalsefalse | true

Whether to loop the keyboard navigation.

navigate—(details: menu.NavigateDetails) => void

Function to navigate to the selected item if it's an anchor element

open—false | true

Whether the menu is open

positioning—calendar.PositioningOptions

The options used to dynamically position the menu

typeaheadtruefalse | true

Whether the pressing printable characters should trigger typeahead navigation

unmountOnExitfalsefalse | true

Whether to unmount on exit.

EmitEvent
escapeKeyDown[event: KeyboardEvent]

Function called when the escape key is pressed

focusOutside[event: FocusOutsideEvent]

Function called when the focus is moved outside the component

highlightChange[details: HighlightChangeDetails]

Function called when the highlighted menu item changes.

interactOutside[event: InteractOutsideEvent]

Function called when an interaction happens outside the component

openChange[details: OpenChangeDetails]

Function called when the menu opens or closes

pointerDownOutside[event: PointerDownOutsideEvent]

Function called when the pointer is pressed down outside the component

select[details: SelectionDetails]

Function called when a menu item is selected.

update:open[open: boolean]

Function called when the menu is opened or closed.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
checked*—boolean

Whether the option is checked

value*—string

The value of the option

asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

closeOnSelect—false | true

Whether the menu should be closed when the option is selected.

disabled—false | true

Whether the menu item is disabled

valueText—string

The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.

EmitEvent
update:checked[value: boolean]
PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

No serializable props or emits are declared for this part.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
value*—string

The unique value of the menu item option.

asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

closeOnSelect—false | true

Whether the menu should be closed when the option is selected.

disabled—false | true

Whether the menu item is disabled

valueText—string

The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.

No serializable props or emits are declared for this part.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

id—string

The `id` of the element that provides accessibility label to the option group

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
value*—string

The value of the option

asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

closeOnSelect—false | true

Whether the menu should be closed when the option is selected.

disabled—false | true

Whether the menu item is disabled

valueText—string

The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

id—string
modelValue—string
EmitEvent
update:modelValue[value: string]
PropDefaultType
value*—UseMenuReturn
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

lazyMountfalsefalse | true

Whether to enable lazy mounting

unmountOnExitfalsefalse | true

Whether to unmount on exit.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
anchorPoint—null | menu.Point

The positioning point for the menu. Can be set by the context menu trigger or the button trigger.

aria-label—string

The accessibility label for the menu

children—null | string | number | bigint | false | true | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").ReactPortal | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined>
closeOnSelecttruefalse | true

Whether to close the menu when an option is selected

compositetruefalse | true

Whether the menu is a composed with other composite widgets like a combobox or tabs

defaultOpen—false | true

The initial open state of the menu when it is first rendered. Use when you do not need to control its open state.

highlightedValue—null | string

The value of the highlighted menu item.

id—string

The unique identifier of the machine.

ids—Partial<{ trigger: string; contextTrigger: string; content: string; groupLabel: (id: string) => string; group: (id: string) => string; positioner: string; arrow: string; }>

The ids of the elements in the menu. Useful for composition.

immediate—false | true

Whether to synchronize the present change immediately or defer it to the next frame

lazyMountfalsefalse | true

Whether to enable lazy mounting

loopFocusfalsefalse | true

Whether to loop the keyboard navigation.

navigate—(details: menu.NavigateDetails) => void

Function to navigate to the selected item if it's an anchor element

onEscapeKeyDown—(event: KeyboardEvent) => void

Function called when the escape key is pressed

onExitComplete—() => void

Function called when the animation ends in the closed state

onFocusOutside—(event: calendar.FocusOutsideEvent) => void

Function called when the focus is moved outside the component

onHighlightChange—(details: menu.HighlightChangeDetails) => void

Function called when the highlighted menu item changes.

onInteractOutside—(event: calendar.InteractOutsideEvent) => void

Function called when an interaction happens outside the component

onOpenChange—(details: menu.OpenChangeDetails) => void

Function called when the menu opens or closes

onPointerDownOutside—(event: calendar.PointerDownOutsideEvent) => void

Function called when the pointer is pressed down outside the component

onSelect—(details: SelectionDetails) => void

Function called when a menu item is selected.

open—false | true

Whether the menu is open

positioning—calendar.PositioningOptions

The options used to dynamically position the menu

present—false | true

Whether the node is present (controlled by the user)

typeaheadtruefalse | true

Whether the pressing printable characters should trigger typeahead navigation

unmountOnExitfalsefalse | true

Whether to unmount on exit.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
checked*—boolean

Whether the option is checked

value*—string

The value of the option

asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

closeOnSelect—false | true

Whether the menu should be closed when the option is selected.

disabled—false | true

Whether the menu item is disabled

onCheckedChange—(checked: boolean) => void

Function called when the option state is changed

valueText—string

The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
children*—(context: MachineApi<PropTypes>) => ReactNode
PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
value*—string

The unique value of the menu item option.

asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

closeOnSelect—false | true

Whether the menu should be closed when the option is selected.

disabled—false | true

Whether the menu item is disabled

valueText—string

The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.

PropDefaultType
children*—(context: UseMenuItemContext) => ReactNode
PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
value*—string

The value of the option

asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

closeOnSelect—false | true

Whether the menu should be closed when the option is selected.

disabled—false | true

Whether the menu item is disabled

valueText—string

The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

onValueChange—(e: ValueChangeDetails$8) => void
value—string
PropDefaultType
value*—UseMenuReturn
children—null | string | number | bigint | false | true | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").ReactPortal | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined>
immediate—false | true

Whether to synchronize the present change immediately or defer it to the next frame

lazyMountfalsefalse | true

Whether to enable lazy mounting

onExitComplete—() => void

Function called when the animation ends in the closed state

present—false | true

Whether the node is present (controlled by the user)

unmountOnExitfalsefalse | true

Whether to unmount on exit.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—false | true

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
anchorPoint—null | menu.Point

The positioning point for the menu. Can be set by the context menu trigger or the button trigger.

aria-label—string

The accessibility label for the menu

children—null | number | false | true | Node | JSX.ArrayElement | (string & {})
closeOnSelecttruefalse | true

Whether to close the menu when an option is selected

compositetruefalse | true

Whether the menu is a composed with other composite widgets like a combobox or tabs

defaultOpen—false | true

The initial open state of the menu when it is first rendered. Use when you do not need to control its open state.

highlightedValue—null | string

The value of the highlighted menu item.

id—string

The unique identifier of the machine.

ids—Partial<{ trigger: string; contextTrigger: string; content: string; groupLabel: (id: string) => string; group: (id: string) => string; positioner: string; arrow: string; }>

The ids of the elements in the menu. Useful for composition.

immediate—false | true

Whether to synchronize the present change immediately or defer it to the next frame

lazyMountfalsefalse | true

Whether to enable lazy mounting

loopFocusfalsefalse | true

Whether to loop the keyboard navigation.

navigate—(details: menu.NavigateDetails) => void

Function to navigate to the selected item if it's an anchor element

onEscapeKeyDown—(event: KeyboardEvent) => void

Function called when the escape key is pressed

onExitComplete—() => void

Function called when the animation ends in the closed state

onFocusOutside—(event: menu.FocusOutsideEvent) => void

Function called when the focus is moved outside the component

onHighlightChange—(details: HighlightChangeDetails) => void

Function called when the highlighted menu item changes.

onInteractOutside—(event: menu.InteractOutsideEvent) => void

Function called when an interaction happens outside the component

onOpenChange—(details: OpenChangeDetails) => void

Function called when the menu opens or closes

onPointerDownOutside—(event: menu.PointerDownOutsideEvent) => void

Function called when the pointer is pressed down outside the component

onSelect—(details: SelectionDetails) => void

Function called when a menu item is selected.

open—false | true

Whether the menu is open

positioning—menu.PositioningOptions

The options used to dynamically position the menu

present—false | true

Whether the node is present (controlled by the user)

typeaheadtruefalse | true

Whether the pressing printable characters should trigger typeahead navigation

unmountOnExitfalsefalse | true

Whether to unmount on exit.

PropDefaultType
asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
checked*—boolean

Whether the option is checked

value*—string

The value of the option

asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

closeOnSelect—false | true

Whether the menu should be closed when the option is selected.

disabled—false | true

Whether the menu item is disabled

onCheckedChange—(checked: boolean) => void

Function called when the option state is changed

valueText—string

The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.

PropDefaultType
asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
children*—(context: Accessor<MachineApi<PropTypes>>) => Element
PropDefaultType
asChild—(props: (userProps?: JSX.ButtonHTMLAttributes<HTMLButtonElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
value*—string

The unique value of the menu item option.

asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

closeOnSelect—false | true

Whether the menu should be closed when the option is selected.

disabled—false | true

Whether the menu item is disabled

valueText—string

The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.

PropDefaultType
children*—(context: UseMenuItemContext) => Element
PropDefaultType
asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
value*—string

The value of the option

asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

closeOnSelect—false | true

Whether the menu should be closed when the option is selected.

disabled—false | true

Whether the menu item is disabled

valueText—string

The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.

PropDefaultType
asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

onValueChange—(e: ValueChangeDetails) => void
value—string
PropDefaultType
value*—UseMenuReturn
children—null | number | false | true | Node | JSX.ArrayElement | (string & {})
immediate—false | true

Whether to synchronize the present change immediately or defer it to the next frame

lazyMountfalsefalse | true

Whether to enable lazy mounting

onExitComplete—() => void

Function called when the animation ends in the closed state

present—false | true

Whether the node is present (controlled by the user)

unmountOnExitfalsefalse | true

Whether to unmount on exit.

PropDefaultType
asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLHRElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—(props: (userProps?: JSX.ButtonHTMLAttributes<HTMLButtonElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
asChild—(props: (userProps?: JSX.HTMLAttributes<HTMLDivElement> | undefined) => JSX.HTMLAttributes<any>) => JSX.Element

Use the provided child element as the default rendered element, combining their props and behavior.

PropDefaultType
anchorPoint—null | import("@destyler/menu").Point

The positioning point for the menu. Can be set by the context menu trigger or the button trigger.

aria-label—string

The accessibility label for the menu

children—Snippet<[]> | undefined
closeOnSelecttruefalse | true

Whether to close the menu when an option is selected

compositetruefalse | true

Whether the menu is a composed with other composite widgets like a combobox or tabs

defaultOpen—false | true

The initial open state of the menu when it is not controlled. Prefer this over seeding with `open` for uncontrolled usage.

highlightedValue—null | string

The value of the highlighted menu item.

id—string
ids—Partial<{ trigger: string; contextTrigger: string; content: string; groupLabel: (id: string) => string; group: (id: string) => string; positioner: string; arrow: string; }>

The ids of the elements in the menu. Useful for composition.

immediate—false | true

Whether to synchronize the present change immediately or defer it to the next frame

lazyMountfalsefalse | true

Whether to enable lazy mounting

loopFocusfalsefalse | true

Whether to loop the keyboard navigation.

navigate—(details: import("@destyler/menu").NavigateDetails) => void

Function to navigate to the selected item if it's an anchor element

onEscapeKeyDown—(event: KeyboardEvent) => void

Function called when the escape key is pressed

onExitComplete—() => void

Function called when the animation ends in the closed state

onFocusOutside—(event: import("@destyler/calendar").FocusOutsideEvent) => void

Function called when the focus is moved outside the component

onHighlightChange—(details: import("@destyler/menu").HighlightChangeDetails) => void

Function called when the highlighted menu item changes.

onInteractOutside—(event: import("@destyler/calendar").InteractOutsideEvent) => void

Function called when an interaction happens outside the component

onOpenChange—(details: import("@destyler/menu").OpenChangeDetails) => void

Function called when the menu opens or closes

onPointerDownOutside—(event: import("@destyler/calendar").PointerDownOutsideEvent) => void

Function called when the pointer is pressed down outside the component

onSelect—(details: import("@destyler/menu").SelectionDetails) => void

Function called when a menu item is selected.

open—false | true

Whether the menu is open

positioning—import("@destyler/calendar").PositioningOptions

The options used to dynamically position the menu

present—false | true

Whether the node is present (controlled by the user)

skipAnimationOnMountfalsefalse | true

Whether to allow the initial presence animation.

typeaheadtruefalse | true

Whether the pressing printable characters should trigger typeahead navigation

unmountOnExitfalsefalse | true

Whether to unmount on exit.

PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
PropDefaultType
checked*—boolean

Whether the option is checked

value*—string

The value of the option

asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
closeOnSelect—false | true

Whether the menu should be closed when the option is selected.

disabled—false | true

Whether the menu item is disabled

onCheckedChange—(checked: boolean) => void

Function called when the option state is changed

valueText—string

The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.

PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
PropDefaultType
render*—Snippet<[UseMenuContext]>
PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"button">]>
children—Snippet<[]> | undefined
PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
PropDefaultType
value*—string

The unique value of the menu item option.

asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
closeOnSelect—false | true

Whether the menu should be closed when the option is selected.

disabled—false | true

Whether the menu item is disabled

valueText—string

The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.

PropDefaultType
render*—Snippet<[UseMenuItemContext]>
PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
id—string

The `id` of the element that provides accessibility label to the option group

PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
PropDefaultType
value*—string

The value of the option

asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
closeOnSelect—false | true

Whether the menu should be closed when the option is selected.

disabled—false | true

Whether the menu item is disabled

valueText—string

The textual value of the option. Used in typeahead navigation of the menu. If not provided, the text content of the menu item will be used.

PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
id—string
onValueChange—(e: import("../index.js").MenuValueChangeDetails) => void
value—string
PropDefaultType
value*—UseMenuReturn
children—Snippet<[]> | undefined
immediate—false | true

Whether to synchronize the present change immediately or defer it to the next frame

lazyMountfalsefalse | true

Whether to enable lazy mounting

onExitComplete—() => void

Function called when the animation ends in the closed state

present—false | true

Whether the node is present (controlled by the user)

skipAnimationOnMountfalsefalse | true

Whether to allow the initial presence animation.

unmountOnExitfalsefalse | true

Whether to unmount on exit.

PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined
PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"button">]>
children—Snippet<[]> | undefined
PropDefaultType
asChild—import("svelte").Snippet<[import("../../../types.js").PropsFn<"div">]>
children—Snippet<[]> | undefined