Takeoff Sidebar
ASecurity`Sidebar` is the side navigation of an application shell: groups of items, items that disclose nested submenus, an optional search row, and header and footer bands. It collapses to an icon-only rail, uncontrolled or driven by the layout around it. **When to use:** The persistent primary navigation of an app or admin shell — the left-hand menu of dashboards, back-office tools, portals. Not for a menu of commands (use `Dropdown`), a temporary off-canvas panel of content (use `Drawer`), or switc...
- 3 stars
- 0 votes
- 0 copies
- 3 views
- 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-sidebar --agent claude-codeAre you the author of Takeoff Sidebar?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/turkishtechnology-takeoff-sidebar)---
name: takeoff-sidebar
description:
'Builds the side navigation of an application shell — the Sidebar from
@takeoff-ui/react-spar (Takeoff UI / Spar React): grouped nav items with
icons, nested submenus, a search row, header and footer bands, and a
collapsible icon rail. Trigger contexts a developer would type: sidebar, side
nav, side navigation, nav drawer, left menu, app menu, navigation rail,
collapsible sidebar, mini sidebar, admin layout menu, TkSidebar. Use this
skill WHENEVER building, adding, importing, styling, or fixing a Sidebar (or
an app-shell side navigation) in a React app that uses @takeoff-ui/react-spar
/ Takeoff / Spar.'
---
# Sidebar — @takeoff-ui/react-spar
`Sidebar` is the side navigation of an application shell: groups of items, items
that disclose nested submenus, an optional search row, and header and footer
bands. It collapses to an icon-only rail, uncontrolled or driven by the layout
around it.
**When to use:** The persistent primary navigation of an app or admin shell —
the left-hand menu of dashboards, back-office tools, portals. Not for a menu of
commands (use `Dropdown`), a temporary off-canvas panel of content (use
`Drawer`), or switching panels in place (use `Tabs`).
## 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 { Sidebar } from '@takeoff-ui/react-spar';
```
## Compound parts
- `Sidebar` — the `<nav>` landmark root; owns the collapsed state and arrow-key
movement between items. `248px` wide, `80px` collapsed.
- `Sidebar.Header` — top band (`type`); children may be a function of
`{ collapsed }`.
- `Sidebar.Trigger` — Takeoff `Button` that collapses / expands the sidebar
(chevron by default; `aria-expanded`, `aria-controls`).
- `Sidebar.Search` — a `role="search"` row for an `Input`; hidden on the rail.
- `Sidebar.Content` — the scrolling body between header and footer.
- `Sidebar.Group` — a `role="group"` of items; `Sidebar.GroupLabel` names it.
- `Sidebar.Item` — one entry, a link (`<a>`) by default; `startContent` (icon),
label (children), `endContent` (count, badge); `current`, `disabled`.
- `Sidebar.Submenu` — an item with nested items (`open` / `defaultOpen` /
`onOpenChange` / `disabled`).
- `Sidebar.SubmenuTrigger` — the item-like disclosure button (`startContent`,
label, chevron indicator).
- `Sidebar.SubmenuContent` — the nested `Sidebar.Item`s.
- `Sidebar.Footer` — bottom band (`type`) for a user row, settings or a support
card; children may be a function of `{ collapsed }`.
## Basic usage
```tsx
<div style={{ height: '100vh' }}>
<Sidebar>
<Sidebar.Header>
<Logo />
<Sidebar.Trigger />
</Sidebar.Header>
<Sidebar.Content>
<Sidebar.Group>
<Sidebar.GroupLabel>Main</Sidebar.GroupLabel>
<Sidebar.Item
href="/"
current
startContent={<DashboardIconOutlinedRounded />}
>
Dashboard
</Sidebar.Item>
<Sidebar.Item
href="/flights"
startContent={<AirplaneIconOutlinedRounded />}
>
Flights
</Sidebar.Item>
</Sidebar.Group>
</Sidebar.Content>
</Sidebar>
</div>
```
## Examples
### Router links and the current page
```tsx
// Pass the router's link through `as`; mark the active route with `current`.
<Sidebar.Item as={NextLink} href="/reports" current={pathname === '/reports'} startContent={<ChartBarIconOutlinedRounded />}>
Reports
</Sidebar.Item>
// An action instead of a link
<Sidebar.Item as="button" onClick={signOut} startContent={<GearIconOutlinedRounded />}>
Sign out
</Sidebar.Item>
```
### Submenu
```tsx
<Sidebar.Submenu defaultOpen>
<Sidebar.SubmenuTrigger startContent={<TicketIconOutlinedRounded />}>
Bookings
</Sidebar.SubmenuTrigger>
<Sidebar.SubmenuContent>
<Sidebar.Item href="/bookings/upcoming">Upcoming</Sidebar.Item>
<Sidebar.Item href="/bookings/past">Past</Sidebar.Item>
</Sidebar.SubmenuContent>
</Sidebar.Submenu>
```
On the collapsed rail the submenu content is not rendered; pressing its trigger
expands the sidebar and opens the submenu.
### Controlled collapse from the app shell
```tsx
const [collapsed, setCollapsed] = useState(false);
<div
style={{ display: 'grid', gridTemplateColumns: 'auto 1fr', height: '100vh' }}
>
<Sidebar collapsed={collapsed} onCollapsedChange={setCollapsed}>
{/* … */}
</Sidebar>
<main>{/* page */}</main>
</div>;
```
Override the widths with `--tk-sidebar-expanded-width` /
`--tk-sidebar-collapsed-width` on the sidebar or an ancestor. The root emits
`data-state="expanded|collapsed"` and `data-collapsed`.
### Bands, search and a collapsed-aware header
```tsx
<Sidebar size="small">
<Sidebar.Header type="primary">
{({ collapsed }) => (
<>
{collapsed ? <LogoMark /> : <Logo />}
<Sidebar.Trigger />
</>
)}
</Sidebar.Header>
<Sidebar.Search>
<Input size="small">
<Input.Prefix>
<SearchIconOutlinedRounded />
</Input.Prefix>
<Input.Field aria-label="Search" placeholder="Search" />
</Input>
</Sidebar.Search>
<Sidebar.Content>{/* groups */}</Sidebar.Content>
<Sidebar.Footer type="divided">
<Avatar name="Ada Lovelace" size="small" />
</Sidebar.Footer>
</Sidebar>
```
### Translated labels
```tsx
<Sidebar
labels={{
landmark: 'Ana menü',
collapse: 'Menüyü daralt',
expand: 'Menüyü genişlet',
}}
>
{/* … */}
</Sidebar>
```
## Key props
| Prop | Type | Default | Notes |
| ------------------- | -------------------------------------------------------- | --------- | ------------------------------------------------------------------------- |
| `collapsed` | `boolean` | - | Controlled collapsed state. |
| `defaultCollapsed` | `boolean` | `false` | Initial collapsed state when uncontrolled. |
| `onCollapsedChange` | `(collapsed: boolean) => void` | - | Fires once per collapsed-state change. |
| `size` | `'small' \| 'base' \| 'large'` | `'base'` | Item padding and gap; `data-size` on the root. |
| `labels` | `Partial<SidebarLabels>` | - | `landmark`, `collapse`, `expand`; merged over provider `defaultProps`. |
| `type` | `'basic' \| 'divided' \| 'light' \| 'dark' \| 'primary'` | `'basic'` | On `Sidebar.Header` / `Sidebar.Footer`; `data-type`. |
| `startContent` | `ReactNode` | - | On `Sidebar.Item` / `Sidebar.SubmenuTrigger`; stays on the rail. |
| `endContent` | `ReactNode` | - | On `Sidebar.Item`; hidden on the rail. |
| `current` | `boolean` | `false` | On `Sidebar.Item`; `aria-current="page"`. |
| `disabled` | `boolean` | `false` | On `Sidebar.Item` (link: `aria-disabled`, no `href`) / `Sidebar.Submenu`. |
| `open` | `boolean` | - | On `Sidebar.Submenu`, with `defaultOpen` / `onOpenChange`. |
Full props, events, data attributes & type definitions: see
`references/full-docs.md`.
## Accessibility
- The root is a `<nav>` landmark named `"Sidebar"` (`labels.landmark`); an
explicit `aria-label` wins.
- `Sidebar.Trigger` has `aria-expanded` and `aria-controls`; its name is
`labels.collapse` / `labels.expand` unless children or `aria-label` are given.
- Groups are `role="group"`, named by their `Sidebar.GroupLabel`.
- On the rail, item labels are visually hidden but still name each item — always
pass a text label, even for icon-first designs.
- Tab moves through items; ArrowUp / ArrowDown / Home / End move between items
(no wrap, disabled items skipped).
## Reference
- Full component docs (Copy page): `references/full-docs.md`
- Live docs: https://v2.takeoffui.com/docs/components/sidebar
- Source: `packages/react-spar/src/components/sidebar/`
- Spar primitive: `packages/spar/src/components/Sidebar/`
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.