Skip to content
Back to skills

Menu

ASecurity

Dropdown menu positioned via ConnectedOverlay (Floating UI). Supports focus trapping, auto-width matching, and animated entrance/exit.

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 27, 2026
data-aitypescriptreactnode

Works with

  • cli

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add reaviz/skills --skill menu --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Menu?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Menu
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reaviz-menu/badge)](https://www.skillsdirectory.com/skills/reaviz-menu)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Menu

Dropdown menu positioned via ConnectedOverlay (Floating UI). Supports focus trapping, auto-width matching, and animated entrance/exit.

## Import

```tsx
import { Menu } from 'reablocks';
```

## Menu Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `open` | `boolean` | `false` | Whether the menu is visible |
| `reference` | `any` | — | Reference element for positioning |
| `children` | `ReactNode \| (() => ReactNode)` | — | Menu content |
| `placement` | `Placement` | `'bottom-start'` | Floating UI placement |
| `appendToBody` | `boolean` | `true` | Portal to body |
| `closeOnBodyClick` | `boolean` | `true` | Close on outside click |
| `closeOnEscape` | `boolean` | `true` | Close on Escape key |
| `autofocus` | `boolean` | `true` | Focus trap on open |
| `autoWidth` | `boolean` | — | Match reference element width |
| `minWidth` | `number` | — | Minimum menu width |
| `maxWidth` | `number` | — | Maximum menu width |
| `maxHeight` | `string` | `'calc(100vh - 48px)'` | Maximum menu height |
| `animated` | `boolean` | `true` | *(deprecated)* Enable animation |
| `animation` | `MotionNodeAnimationOptions` | — | Custom animation config |
| `modifiers` | `Modifiers` | — | Floating UI middleware |
| `className` | `string` | — | Menu container CSS classes |
| `style` | `CSSProperties` | — | Inline styles |
| `onClose` | `(event: OverlayEvent) => void` | — | Close handler |
| `onMouseEnter` | `(event) => void` | — | Mouse enter handler |
| `onMouseLeave` | `(event) => void` | — | Mouse leave handler |
| `theme` | `MenuTheme` | — | Per-instance theme override |

## Basic Usage

```tsx
const ref = useRef();
const [open, setOpen] = useState(false);

<Button ref={ref} onClick={() => setOpen(!open)}>Open Menu</Button>
<Menu open={open} reference={ref} onClose={() => setOpen(false)}>
  <List>
    <ListItem onClick={() => action1()}>Item 1</ListItem>
    <ListItem onClick={() => action2()}>Item 2</ListItem>
    <ListItem onClick={() => action3()}>Item 3</ListItem>
  </List>
</Menu>
```

## Auto Width

Match menu width to reference element:

```tsx
<Menu open={open} reference={ref} autoWidth onClose={close}>
  {() => <List>...</List>}
</Menu>
```

## MenuTheme Interface

```typescript
interface MenuTheme {
  base: string;   // Outer container (relative, min-w, max-w, padding)
  inner: string;  // Inner container (focus:outline-hidden, bg, text)
}
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data-ai →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.