# Panel Menu (Andromeda Legacy)

Panel Menu is a component of the free, MIT-licensed Andromeda Legacy design system from AI Canvas (https://aicanvas.me). Index of every system, component and install setup: https://aicanvas.me/llms.txt

Kebab-trigger overflow menu for panel headers. Items can have icons, separators, and a single level of right-flyout submenu. Closes on outside click and Escape.

- Design system: [Andromeda Legacy](https://aicanvas.me/design-systems/andromeda.md)
- License: MIT
- Install slug: `andromeda-panel-menu`
- Page: https://aicanvas.me/design-systems/andromeda/panel-menu

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-panel-menu
```

Needs a free AI Canvas account; signed out, the command writes a placeholder (an `AccountRequired` notice) instead.

Every Andromeda Legacy component at once: `npx shadcn@latest add @aicanvas/andromeda`.

Token setup: the Install section of https://aicanvas.me/llms.txt.

## Use it

It installs to `components/aicanvas/andromeda/components/PanelMenu.tsx` (under `src/` if your project has one). With the usual `@/` alias:

```tsx
import { PanelMenu } from '@/components/aicanvas/andromeda/components/PanelMenu'
```

## Example

```tsx
import { PanelMenu } from '@/components/aicanvas/andromeda/components/PanelMenu'

<PanelMenu
  ariaLabel="Invoice actions"
  items={[
    { label: 'Refresh', onSelect: () => window.location.reload() },
    { label: 'Print', onSelect: () => window.print() },
  ]}
/>
```

## Parts

Panel Menu is built from `MenuItem` and `PanelMenu`. Each part has its own props table below.

## Variants

- `align` on `PanelMenu`: left or right (default 'right')

## Props

### MenuItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label?` | `string` |  | Text shown for the menu item. |
| `icon?` | `React.ComponentType<IconProps>` |  | Icon rendered to the left of the label. |
| `onSelect?` | `() => void` |  | Handler called when the item is chosen (ignored on items with a submenu). |
| `submenu?` | `MenuItem[]` |  | Nested items opened as a flyout submenu. |
| `selected?` | `boolean` |  | Marks the item as the active choice, styling it accordingly. |
| `destructive?` | `boolean` |  | Renders the item label in the destructive red color. |
| `type?` | `'separator'` |  | Set to 'separator' to render a divider rule instead of a clickable item. |

### PanelMenu

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` | `MenuItem[]` |  | Entries rendered in the menu, in order. |
| `align?` | `'left'\|'right'` | `'right'` | Edge of the trigger the menu aligns to. |
| `ariaLabel?` | `string` | `'Panel options'` | Accessible label for the kebab trigger button. |
| `defaultOpen?` | `boolean` | `false` | Render the menu pre-opened. Useful in showcases / docs so the consumer can see the menu contents without first having to click the trigger. Click-outside and Escape still dismiss it. |
| `staticOpen?` | `boolean` | `false` | Like defaultOpen, but the menu stays open: the click-outside and Escape dismissers are not attached. For showcases / docs where the menu must remain visible as the reader scrolls past, so the component reads as a menu without any interaction. The trigger can still toggle it. Not for product UI; a real overflow menu must dismiss. |
| `className?` | `string` |  | Extra class applied to the wrapper element. |
| `style?` | `React.CSSProperties` |  | Inline styles merged onto the wrapper element. |

## More Andromeda Legacy components

- [Planet](https://aicanvas.me/design-systems/andromeda/planet.md)
- [Progress Bar](https://aicanvas.me/design-systems/andromeda/progress-bar.md)
- [Radar Chart](https://aicanvas.me/design-systems/andromeda/radar-chart.md)
- [Radio](https://aicanvas.me/design-systems/andromeda/radio.md)
- [Search Field](https://aicanvas.me/design-systems/andromeda/search-field.md)
