Curtain Menu
ComponentsCurtain Menu
NavigationNew

Curtain Menu

Give navigation the whole stage. A sweeping curtain makes way for oversized destinations.

React + CSS
Live component. Go ahead, interact.
01

Installation

Run this in your shadcn-configured React project. The component and stylesheet are added together.

TERMINAL
npx shadcn@latest add http://localhost:5173/r/curtain-menu.json

This command uses the current site address. For localhost, keep this preview running on the same computer. Files follow your configured components alias.

02

Usage

Import the component and make the details your own.

TypeScript
import { CurtainMenu } from '@/components/anticraft/CurtainMenu';

export function Example() {
  return (
    <CurtainMenu
      label="Explore menu"
      title="Where next?"
      activeId="work"
      footer={<a href="mailto:hello@example.com">Have a project in mind? Say hello ↗</a>}
      items={[
        { id: 'work', label: 'Selected work', href: '/#work', description: 'Made with a point of view.' },
        { id: 'about', label: 'The studio', href: '/#about', description: 'A few good people and a lot of curiosity.' },
        { id: 'contact', label: 'Let’s talk', href: '/#contact', description: 'Your next good idea starts here.' },
      ]}
    />
  );
}
03

Props

PropTypeDefaultDescription
itemsCurtainMenuItem[]RequiredDestinations with a unique id, visible label, and real href. Replace the example URLs with destinations in your project.
activeIdstringundefinedThe controlled id of the current destination. Only that link receives aria-current="page". Update this from your route or selected section.
labelstring'Explore menu'The accessible navigation label. Disclosure components also use it for their visible trigger.
onNavigate(id: string, event: MouseEvent<HTMLAnchorElement>) => voidundefinedRuns when a destination is activated. Anchors navigate normally; call event.preventDefault() only when handling navigation yourself, such as a local preview or router adapter.
classNamestring''Additional classes for sizing and CSS custom properties. Each component imports its matching stylesheet; keep both files together.
items[].descriptionstringundefinedOptional supporting text beside each destination; it moves below the label on small screens.
titlestring'Where next?'The visible heading and accessible name for the modal navigation sheet.
footerReactNodeundefinedOptional supporting content or links beneath the destinations.
onOpenChange(open: boolean) => voidundefinedReceives changes to the internal disclosure state when visitors open, dismiss, or navigate.
04

Motion & accessibility

Considered by default.

The trigger opens a native modal dialog above the page. Its close control receives initial focus; the browser keeps keyboard focus in the dialog and makes the background unavailable. Escape, Close, or destination activation dismisses it and restores trigger focus. Closed navigation stays out of the focus order. The sheet scrolls independently for longer content. Reduced motion removes the curtain sweep and row entrances. Set --ac-curtain-background, --ac-curtain-foreground, --ac-curtain-accent, and --ac-curtain-display-font to style the sheet.

Use semantic content and meaningful labels in your composition. Check contrast and keyboard behavior with your own styles and content.