Skip to content

Folding Menu

Numbered navigation panels unfold beneath a compact, tactile trigger.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import FoldingMenu from "./FoldingMenu";
export default function Example() {
return (
<FoldingMenu
trigger={"Explore the studio"}
items={[
{
"id": "work",
"label": "The collection",
"description": "Browse every component",
"href": "/components"
},
{
"id": "backgrounds",
"label": "Backgrounds",
"description": "Set the atmosphere",
"href": "/categories/backgrounds"
},
{
"id": "about",
"label": "About the library",
"description": "How it all works",
"href": "/about"
}
]}
defaultOpen={true}
label={"Studio navigation"}
color={"#c1b1d4"}
background={"#29242f"}
/>
);
}

Using Folding Menu

Provide real destinations through items and a trigger label that describes the navigation. The menu expands in normal document flow, so allow space below it.

Closed links are inert and hidden from assistive technology. Escape closes the menu and restores trigger focus; outside pointer interaction also dismisses it.

Props

NameTypeRequiredDefaultDescription
itemsArray<{ id?, label, href, description? }>No[]Navigation links and optional supporting descriptions.
triggerReactNodeNoundefinedTrigger button content.
openbooleanNoundefinedControlled expanded state.
defaultOpenbooleanNofalseInitial uncontrolled expanded state.
onOpenChangefunctionNoundefinedReceives the requested expanded state.
onSelectfunctionNoundefinedReceives the clicked item and event; preventDefault can override navigation.
labelstringNo"Navigation"Accessible navigation name and fallback trigger label.
colorstringNo"#c1b1d4"Trigger and focus colour.
backgroundstringNo"#29242f"Unfolded panel colour.
classNamestringNo""Additional classes on the root element.
styleCSSPropertiesNoundefinedInline styles for sizing, typography and appearance.

Related components

Pagination Rail

Navigation

A raised selection moves through a compact row of numbered page controls.

Layered chevron tabs create a compact trail with a distinct current page.

Path Stepper

Navigation

Numbered stops connect into a clean vertical route with completed and current states.

Bookmark Tabs

Navigation

Numbered paper tabs with a bookmark ribbon and an inset content panel.