The trigger's visible label: what the menu acts on ("Actions", "More for capsid").
aria-label
string
Needed when the label is not plain text, for example an icon-only trigger.
items
MenuEntry[]
Yes
disabled
boolean
container
HTMLElement | null
Where the popup is portaled. Inside a modal <dialog> pass the dialog.
defaultOpen
boolean
For specimens and tests: open on mount.
chevron
boolean
The trigger's down chevron; false for an icon trigger that says what it opens (the player's).
FormMenu
Prop
Type
Required
Does
label
ReactNode
Yes
The summary's visible text: what the menu acts on ("Actions for example.org").
aria-label
string
action
string
Where the form posts, and its method (post unless a GET filter is meant). Not needed with form.
form
string
The id of a form elsewhere on the page that the items submit (a card inside a list whose one form carries the row's fields): the menu renders no form of its own, and each item's button names that form. hidden is then not sent; the outer form carries its fields.
size
"sm"
The trigger's size: "sm" in a dense row or a card.
method
"post" | "get"
items
FormMenuItem[]
Yes
name
string
The field the button's value goes in. intent unless the server expects another name.
hidden
Record<string, string>
Fields every item sends with it: the row's id, a return address.
Functions
Function
Signature
Does
stepIndex
(count: number, from: number, dir: 1 | -1): number
Moves to the next or previous button, wrapping; from is the focused one, or -1.
enhance
(root?: ParentNode): () => void
CSS variables
Variable
Default
--anchor-width
0px
--available-height
set by the page
--available-width
set by the page
Parts and data attributes
Class
Is
.cap-menu
the root
.cap-menu-chevron
a part
.cap-menu-form
a part
.cap-menu-item
a part
.cap-menu-positioner
a part
.cap-menu-reason
a part
.cap-menu-trigger
a part
Attribute
Values
data-instant
present or absent
data-popup-open
present or absent
data-submenu
present or absent
data-tone
crit
State
Read from
:disabled
the platform
:focus-visible
the platform
:hover
the platform
[open]
an attribute
Accessibility
Key
Does
Enter, Space or ArrowDown on the trigger
Opens the menu with its first item focused
ArrowDown, ArrowUp
Move between items, skipping separators, wrapping at the ends
ArrowRight on a submenu item
Opens the submenu on its first item
ArrowLeft, or Esc, in a submenu
Closes the submenu; focus returns to its item
Space or Enter on a checkbox or radio item
Toggles or chooses it
A letter
Moves to the next item that starts with it
Enter or Space on an item
Runs it and closes the menu; focus returns to the trigger
Esc
Closes the menu; focus returns to the trigger
Tab
Closes the menu and moves on
The menu is named by its trigger (aria-labelledby, from Base UI). Checkbox and radio items are menuitemcheckbox and menuitemradio with aria-checked; a submenu item has aria-haspopup="menu"; a group is named by its label.
Disabled items carry aria-disabled="true" and stay focusable (Base UI's focusableWhenDisabled), so the reason is heard.
Forced colors: the highlighted item gets a Highlight outline, the separator a CanvasText rule.
Inside a modal dialog, pass the dialog as container, or the popup renders under the top layer, out of sight.