Utility
Terminal
█
menu-demo █
Loading preview... █
█
█
█
█
█
█
█
█
█
█
█
█
█
█
█Installation
$ pnpm dlx shadcn@latest add @termcn/opentui/menu
Usage
import { Menu } from "@/components/ui/menu";<Menu
title="File"
items={[
{ key: "new", label: "New File", shortcut: "⌘N" },
{ key: "save", label: "Save", shortcut: "⌘S" },
]}
onSelect={(item) => console.log(item.key)}
/>API Reference
Menu
| Prop | Type | Default |
|---|---|---|
items | MenuItem[] | required |
onSelect | (item: MenuItem) => void | - |
title | string | - |
MenuItem
| Prop | Type | Default |
|---|---|---|
key | string | required |
label | string | required |
icon | string | - |
shortcut | string | - |
disabled | boolean | - |
separator | boolean | - |
children | MenuItem[] | - |