Takeoff Mega Menu
ASecurity`MegaMenu` is site navigation whose top-level items open large panels: grouped links with icons and descriptions, a category list on the side, images and promo cards. Behavior — which panel is open, hover intent, the arrow keys, Escape and closing on an outside press — is Spar's `MegaMenu` (the WAI-ARIA disclosure navigation pattern, not `role="menu"`); the look follows the Takeoff design. **When to use:** main site navigation with many destinations that need grouping, descriptions or imagery...
- 3 stars
- 0 votes
- 0 copies
- 1 view
- Added December 4, 2026
Works with
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add turkishtechnology/takeoff-v2 --skill takeoff-mega-menu --agent claude-codeAre you the author of Takeoff Mega Menu?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/turkishtechnology-takeoff-mega-menu)---
name: takeoff-mega-menu
description:
'Build a MegaMenu (site navigation whose top-level items open large panels:
grouped links with icons and descriptions, a category sidebar, images and
promo cards) — the MegaMenu from @takeoff-ui/react-spar (Takeoff UI / Spar
React). Trigger when adding a mega menu, mega dropdown, flyout navigation,
multi-column nav panel, category navigation in a header, or hover-to-open main
navigation. Use this skill WHENEVER building, adding, importing, styling, or
fixing a MegaMenu in a React app that uses @takeoff-ui/react-spar / Takeoff /
Spar. Not for an action menu of commands — use Dropdown; not for app-shell
side navigation — use Sidebar.'
---
# MegaMenu — @takeoff-ui/react-spar
`MegaMenu` is site navigation whose top-level items open large panels: grouped
links with icons and descriptions, a category list on the side, images and promo
cards. Behavior — which panel is open, hover intent, the arrow keys, Escape and
closing on an outside press — is Spar's `MegaMenu` (the WAI-ARIA disclosure
navigation pattern, not `role="menu"`); the look follows the Takeoff design.
**When to use:** main site navigation with many destinations that need grouping,
descriptions or imagery. Not this — a short list of commands is `Dropdown`; a
handful of plain links is `Header.Nav` with `Header.NavLink`; app-shell side
navigation is `Sidebar`.
## Setup
Requires the Takeoff provider + token CSS mounted once at the app root (see the
`takeoff-ui` skill or the installation docs). Then import:
```tsx
import { MegaMenu } from '@takeoff-ui/react-spar';
```
## Compound parts
- `MegaMenu` — root. Holds `size`, `openOn` (`hover` | `click`), `openDelay`,
`closeDelay`, `orientation`, `disabled` and the open item's `value` /
`defaultValue` / `onValueChange` (`''` means every panel is closed).
- `MegaMenu.List` — `<ul>` of top-level items; arrow keys, Home and End move
between them.
- `MegaMenu.Item` — `<li>` with a unique `value`. Holds either a `Trigger` +
`Content` pair, or a single `Link` for an item with no panel.
- `MegaMenu.Trigger` — `<button>` with `aria-expanded` / `aria-controls` and its
own chevron; `startContent` for an icon.
- `MegaMenu.Content` — the panel, named by its trigger. `forceMount` keeps it in
the DOM while closed (for SEO crawlers).
- `MegaMenu.Link` — a link (`as={Link}` for a router). `active` sets
`aria-current="page"`; `disabled` drops `href`; `startContent` / `endContent`;
a nested `MegaMenu.Description` is the secondary line. Pressing it closes the
panel and, inside `Header`, the collapsed header menu.
- Panel layout, all optional: `MegaMenu.Tabs` (vertical category switcher, hover
or arrow keys select) with `MegaMenu.Sidebar` (`variant` basic | divided |
light | dark | primary), `MegaMenu.TabList` (`aria-label`, default
"Categories"), `MegaMenu.Tab` and `MegaMenu.TabPanel`; `MegaMenu.Media`
(`placement` start | end | top | bottom); `MegaMenu.Body`; `MegaMenu.Title`;
`MegaMenu.Description`; `MegaMenu.Grid` (`columns` 1 | 2 | 3);
`MegaMenu.Group` + `MegaMenu.GroupTitle` (`variant`); `MegaMenu.Card` (`<a>`
with an `image`).
## Basic usage
```tsx
<MegaMenu aria-label="Main">
<MegaMenu.List>
<MegaMenu.Item value="products">
<MegaMenu.Trigger>Products</MegaMenu.Trigger>
<MegaMenu.Content>
<MegaMenu.Body>
<MegaMenu.Grid>
<MegaMenu.Link
href="/flights"
startContent={<AirplaneIconOutlinedRounded />}
>
Flights
<MegaMenu.Description>
Book and manage flights
</MegaMenu.Description>
</MegaMenu.Link>
<MegaMenu.Link href="/hotels">Hotels</MegaMenu.Link>
</MegaMenu.Grid>
</MegaMenu.Body>
</MegaMenu.Content>
</MegaMenu.Item>
<MegaMenu.Item value="help">
<MegaMenu.Link href="/help">Help</MegaMenu.Link>
</MegaMenu.Item>
</MegaMenu.List>
</MegaMenu>
```
## Examples
### Inside the Header
Put the menu in `Header.Nav`. No Header prop is needed: the menu takes the
header's link look, its panels span the header bar, and below 1248px of header
width (the collapsed header) the items stack as an accordion inside the header
menu. Escape closes the open panel first, then the header menu.
```tsx
<Header>
<Header.Bar>
<Header.MenuToggle />
<Header.Brand as="a" href="/">
…
</Header.Brand>
<Header.Nav>
<MegaMenu>
<MegaMenu.List>…</MegaMenu.List>
</MegaMenu>
</Header.Nav>
</Header.Bar>
</Header>
```
### Category sidebar with tabs
```tsx
<MegaMenu.Content>
<MegaMenu.Tabs defaultValue="flights">
<MegaMenu.Sidebar variant="dark">
<MegaMenu.TabList aria-label="Travel categories">
<MegaMenu.Tab value="flights">Flights</MegaMenu.Tab>
<MegaMenu.Tab value="extras">Extras</MegaMenu.Tab>
</MegaMenu.TabList>
</MegaMenu.Sidebar>
<MegaMenu.TabPanel value="flights">
<MegaMenu.Media placement="start">
<img src={hero} alt="" />
</MegaMenu.Media>
<MegaMenu.Body>
<MegaMenu.Title as="h2">Flights</MegaMenu.Title>
<MegaMenu.Grid>…</MegaMenu.Grid>
</MegaMenu.Body>
</MegaMenu.TabPanel>
<MegaMenu.TabPanel value="extras">…</MegaMenu.TabPanel>
</MegaMenu.Tabs>
</MegaMenu.Content>
```
### Columns of groups, click to open, controlled
```tsx
const [open, setOpen] = useState('');
<MegaMenu openOn="click" value={open} onValueChange={setOpen}>
<MegaMenu.List>
<MegaMenu.Item value="miles">
<MegaMenu.Trigger>Miles</MegaMenu.Trigger>
<MegaMenu.Content>
<MegaMenu.Body>
<MegaMenu.Grid columns={3}>
<MegaMenu.Group>
<MegaMenu.GroupTitle variant="divided">Earn</MegaMenu.GroupTitle>
<MegaMenu.Link
as={NavLink}
to="/miles/earn"
active={pathname === '/miles/earn'}
>
On flights
</MegaMenu.Link>
</MegaMenu.Group>
</MegaMenu.Grid>
</MegaMenu.Body>
</MegaMenu.Content>
</MegaMenu.Item>
</MegaMenu.List>
</MegaMenu>;
```
## Key props
### `MegaMenu` (root)
| Prop | Type | Default | Notes |
| --------------- | ------------------------------ | -------------- | -------------------------------------------------------- |
| `size` | `'small' \| 'base' \| 'large'` | `'base'` | Trigger, link and tab sizing. |
| `openOn` | `'hover' \| 'click'` | `'hover'` | Click and keys always open; touch never opens on hover. |
| `openDelay` | `number` | `150` | Hover intent in ms; switching between panels is instant. |
| `closeDelay` | `number` | `300` | Grace period in ms after the pointer leaves the menu. |
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Vertical opens panels to the side with ArrowRight. |
| `value` | `string` | - | Controlled open item; `''` closes all. |
| `defaultValue` | `string` | `''` | Uncontrolled initial open item. |
| `onValueChange` | `(value: string) => void` | - | Open, close, Escape, outside press, link press. |
| `disabled` | `boolean` | `false` | Disables every trigger. |
Full props, events, data attributes & type definitions: see
`references/full-docs.md`.
## Accessibility
- Name the menu: `aria-label` on the root when it is not inside a named
`Header.Nav` (wrap a standalone menu in `<nav>` or pass `as="nav"`).
- Keyboard: Tab reaches each trigger and top-level link; arrow keys, Home and
End move between them; Enter, Space or ArrowDown (ArrowRight when vertical)
opens a panel and focuses its first link; Escape closes it and refocuses the
trigger; focus leaving the menu closes it.
- Give each `MegaMenu.Title` a heading level that fits the page (`as="h2"`), and
name each `MegaMenu.TabList` when there are several.
- Decorative media gets `alt=""`; a link's icon is `aria-hidden`.
## Reference
- Full component docs (Copy page): `references/full-docs.md`
- Live docs: https://v2.takeoffui.com/docs/components/mega-menu
- Source: `packages/react-spar/src/components/mega-menu/`
- Spar primitive: https://v2.takeoffui.com/headless/docs/Components/MegaMenu
Files in this skill
- SKILL.md
- references/full-docs.md
Attribution
Related skills
View all in design →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.