Menu
드롭다운 Menu와 컨텍스트 Menu를 제공하는 컴포넌트입니다Property
Disabled
Menu의 비활성화 상태를 설정합니다.
Examples
Positioning
Menu의 표시 위치를 설정합니다.
Groups
Menu 아이템을 그룹화합니다.
With Checkbox Items
Checkbox Item을 사용합니다.
With Radio Items
Radio Item을 사용합니다.
With Submenu
Submenu를 구성할 수 있습니다.
Props Table
Menu.Root
Root of the Menu compound component, a list of actions or options that opens from a trigger. Manages the open state and, when disabled, disables the trigger and every item. Doesn't render its own HTML element.
| Prop | Default | Type |
|---|---|---|
defaultOpen? | false | boolean |
onOpenChange? | - | function |
open? | - | boolean |
actionsRef? | - | React.RefObject<Menu.Root.Actions | null> |
children? | - | ReactNodefunction |
closeParentOnEsc? | false | boolean |
defaultTriggerId? | - | stringnull |
disabled? | false | boolean |
handle? | - | MenuHandle<unknown> |
highlightItemOnHover? | true | boolean |
loopFocus? | true | boolean |
modal? | true | boolean |
onItemHighlighted? | - | function |
onOpenChangeComplete? | - | function |
orientation? | vertical | horizontalvertical |
triggerId? | - | stringnull |
Menu.Trigger
Button that opens the menu when clicked. Renders a <button> element.
| Prop | Default | Type |
|---|---|---|
children? | - | ReactNode |
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
closeDelay? | 0 | number |
delay? | 100 | number |
disabled? | false | boolean |
handle? | - | MenuHandle<unknown> |
nativeButton? | true | boolean |
openOnHover? | - | boolean |
payload? | - | unknown |
render? | - | ReactElementfunction |
Menu.PositionerPrimitive
Combines Menu.PortalPrimitive, Menu.PositionerPrimitive, and Menu.PopupPrimitive into a single part. Use portalElement or positionerElement to replace the portal or positioner. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
children? | - | ReactNode |
className? | - | stringfunction |
portalElement? | - | ReactElement<MenuPortalPrimitive.Props> |
positionerElement? | - | ReactElement<MenuPositionerPrimitive.Props> |
style? | - | React.CSSPropertiesfunction |
finalFocus? | - | booleanReact.RefObject<HTMLElement | null>function |
render? | - | ReactElementfunction |
Menu.PortalPrimitive
Portal container that renders the menu outside the normal DOM hierarchy. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
container? | - | HTMLElementShadowRootReact.RefObject<HTMLElement | ShadowRoot | null>null |
keepMounted? | false | boolean |
render? | - | ReactElementfunction |
Menu.PositionerPrimitive
Positions the menu popup against its trigger and keeps it inside the viewport. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
align? | start | centerendstart |
alignOffset? | 0 | numberfunction |
anchor? | - | ElementVirtualElementReact.RefObject<Element | null>functionnull |
arrowPadding? | 5 | number |
collisionAvoidance? | - | CollisionAvoidance |
collisionBoundary? | clipping-ancestors | Boundary |
collisionPadding? | 5 | Padding |
disableAnchorTracking? | false | boolean |
positionMethod? | absolute | fixedabsolute |
side? | bottom | bottomleftrighttopinline-endinline-start |
sideOffset? | 4 | numberfunction |
sticky? | false | boolean |
render? | - | ReactElementfunction |
Menu.PopupPrimitive
The menu panel that holds the menu items. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
children? | - | ReactNode |
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
finalFocus? | - | booleanReact.RefObject<HTMLElement | null>function |
render? | - | ReactElementfunction |
Menu.CheckboxItemIndicatorPrimitive
Interactive item in the menu that runs an action when selected. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
closeOnClick? | true | boolean |
disabled? | false | boolean |
label? | - | string |
nativeButton? | false | boolean |
onClick? | - | function |
render? | - | ReactElementfunction |
Menu.RadioItemIndicatorPrimitive
Line that visually separates groups of menu items. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
orientation? | horizontal | horizontalvertical |
render? | - | ReactElementfunction |
Menu.Group
Groups related menu items under a Menu.GroupLabel. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
children? | - | ReactNode |
render? | - | ReactElementfunction |
Menu.GroupLabel
Label for a menu group, announced to assistive technologies. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
render? | - | ReactElementfunction |
Menu.SubmenuRoot
Root of a nested submenu inside a menu. Place Menu.SubmenuTriggerItem and Menu.SubmenuPopup inside it. Doesn't render its own HTML element.
| Prop | Default | Type |
|---|---|---|
defaultOpen? | false | boolean |
onOpenChange? | - | function |
open? | - | boolean |
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
actionsRef? | - | React.RefObject<Menu.Root.Actions | null> |
children? | - | ReactNode |
closeParentOnEsc? | false | boolean |
disabled? | false | boolean |
highlightItemOnHover? | true | boolean |
loopFocus? | true | boolean |
onItemHighlighted? | - | function |
onOpenChangeComplete? | - | function |
orientation? | vertical | horizontalvertical |
render? | - | ReactElementfunction |
Menu.SubmenuTriggerItem
Menu item that opens a submenu, with a chevron icon at the end. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
className? | - | stringfunction |
onClick? | - | function |
style? | - | React.CSSPropertiesfunction |
closeDelay? | 0 | number |
delay? | 100 | number |
disabled? | false | boolean |
label? | - | string |
nativeButton? | false | boolean |
openOnHover? | true | boolean |
render? | - | ReactElementfunction |
Menu.SubmenuPopup
Combines Menu.PortalPrimitive, Menu.PositionerPrimitive, and Menu.PopupPrimitive into a single part that opens to the right of its trigger item. Use portalElement or positionerElement to replace the portal or positioner. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
children? | - | ReactNode |
className? | - | stringfunction |
portalElement? | - | ReactElement<MenuPortalPrimitive.Props> |
positionerElement? | - | ReactElement<MenuPositionerPrimitive.Props> |
style? | - | React.CSSPropertiesfunction |
finalFocus? | - | booleanReact.RefObject<HTMLElement | null>function |
render? | - | ReactElementfunction |
Menu.SubmenuPopupPrimitive
The submenu panel that holds the nested menu items. Returns focus to Menu.SubmenuTriggerItem when it closes. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
children? | - | ReactNode |
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
finalFocus? | - | booleanReact.RefObject<HTMLElement | null>function |
render? | - | ReactElementfunction |
Menu.CheckboxItem
Combines Menu.CheckboxItemPrimitive and Menu.CheckboxItemIndicatorPrimitive into a single part, with the check mark after the label. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
checked? | - | boolean |
defaultChecked? | false | boolean |
onCheckedChange? | - | function |
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
closeOnClick? | false | boolean |
disabled? | false | boolean |
label? | - | string |
nativeButton? | false | boolean |
onClick? | - | function |
render? | - | ReactElementfunction |
Menu.CheckboxItemPrimitive
Menu item that toggles a setting on or off. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
checked? | - | boolean |
defaultChecked? | false | boolean |
onCheckedChange? | - | function |
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
closeOnClick? | false | boolean |
disabled? | false | boolean |
label? | - | string |
nativeButton? | false | boolean |
onClick? | - | function |
render? | - | ReactElementfunction |
Menu.CheckboxItemIndicatorPrimitive
Check mark shown while the checkbox item is checked. Renders a <span> element.
| Prop | Default | Type |
|---|---|---|
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
keepMounted? | true | boolean |
render? | - | ReactElementfunction |
Menu.RadioGroup
Groups radio items so that only one of them can be selected at a time. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
defaultValue? | - | any |
onValueChange? | - | function |
value? | - | any |
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
children? | - | ReactNode |
disabled? | false | boolean |
render? | - | ReactElementfunction |
Menu.RadioItem
Combines Menu.RadioItemPrimitive and Menu.RadioItemIndicatorPrimitive into a single part, with the check mark after the label. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
value | - | any |
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
closeOnClick? | false | boolean |
disabled? | false | boolean |
label? | - | string |
nativeButton? | false | boolean |
onClick? | - | function |
render? | - | ReactElementfunction |
Menu.RadioItemPrimitive
Menu item that works like a radio button inside Menu.RadioGroup. Renders a <div> element.
| Prop | Default | Type |
|---|---|---|
value | - | any |
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
closeOnClick? | false | boolean |
disabled? | false | boolean |
label? | - | string |
nativeButton? | false | boolean |
onClick? | - | function |
render? | - | ReactElementfunction |
Menu.RadioItemIndicatorPrimitive
Check mark shown while the radio item is selected. Renders a <span> element.
| Prop | Default | Type |
|---|---|---|
className? | - | stringfunction |
style? | - | React.CSSPropertiesfunction |
keepMounted? | false | boolean |
render? | - | ReactElementfunction |