A shadcn-style menu component built with Ark UI primitives.

Last:

Installation

npx shadcn@latest add @ark-cn/menu

Usage

import * as Menu from "@/components/ui/menu"

Read exported parts in src/components/ui/menu.tsx and compose the primitive according to the Ark UI pattern for this component.

Examples

Grouping

Checkbox items

Radio items

Context menu

Nested

In dialog

Item dialog

Controlled

Context hook

Positioning

Trigger indicator

Close on select

Multiple triggers

Alice Johnson

Hey, can you review the latest PR?

Bob Smith

Meeting notes from today are attached.

Carol Davis

The deploy finished successfully!

Multiple menus

Context lazy mount

Item context row

Select event

Pick an item...

API reference

This component mirrors the upstream Ark UI primitive. All props and DOM behavior are defined by Ark unless you see an ark-cn-only row below.

MenuPopup

PropTypeDescription
arrowClassName?stringClass on the arrow element.
arrowTipClassName?stringClass on the arrow tip.
disablePortal?booleanRenders content in-place instead of portaled.
positionerClassName?stringExtra class on the positioner wrapper.
showArrow?booleanToggles the arrow (default false).

See the ARK UI documentation for the full API.

Accessibility

See the Ark UI documentation for clarification.