registry
@automindzsheets 01–77shadcn 4.x
SHEET 23

Site Nav

block / marketing / layout

Top navigation with a grouped mega-panel, keyboard column navigation, active-route marking, a scroll condense and a mobile drawer.

type
block
files
2
registry deps
badge, button, sheet, @automindz/render-link
npm deps
lucide-react

installs

  • lib/automindz/nav-links.ts
  • components/automindz/site-nav.tsx
  • Escape closes the panel, focus returns to the trigger.
  • Compact bar is the base state; scroll adds height.
  • Disabled links stay focusable and say why.

Links are data in lib/automindz/nav-links.ts; pass links to load them from elsewhere. You wire logo, renderLink (for next/link) and a <main id="main-content"> for the skip link. currentPath changes everything: it drives aria-current="page" — panel items included — and closes the panel and the drawer on navigation. The panel is a portal-free absolute disclosure, so the header must not sit inside an overflow: hidden ancestor. Its lib is nav-links.ts: shadcn add rewrites imports by basename.

Variations

one state per section

01

The bar

Logo slot, links, a secondary and a primary action. The skip link is the first thing Tab reaches — press Tab from the top of this frame and it appears over the bar. Nothing here is hover-only: every panel trigger is a real button.

fluid
Skip to content
AutoMindz Solutions

AutoMindz Solutions

The bar a client app wakes up with.

Page content sits under the bar. The panel opens over it and is never clipped, because the header owns no overflow of its own.

02

Panel open

Rendered open so the anatomy is visible without hovering: three columns of real links, one line of description each, and the section's own page on a rule at the foot. Inside it, Tab follows DOM order, Arrow keys move by column and across columns, Home and End jump to the ends. Escape closes it and puts focus back on the trigger.

fluid
03

Where you are

currentPath is /product/automations. The exact match inside the panel carries aria-current="page" with a fill and a heavier label; the trigger above it takes a dotted underline, because it holds the page rather than being it. Two different marks, neither of them colour alone.

fluid
05

Condensed on scroll

One registered custom property, one scroll timeline: the bar rests roomy at the top of the document and tightens over the first 100px. The compact state is the base state, so a browser without scroll-driven animation — or a reader who asked for less motion — gets a tight bar rather than one that covers the page. Scroll this page to watch it.

fluid
Skip to content
AutoMindz Solutions

AutoMindz Solutions

The bar a client app wakes up with.

Page content sits under the bar. The panel opens over it and is never clipped, because the header owns no overflow of its own.

06

Below 768px

The breakpoint is measured against the header, not the viewport, so a bar in a narrow column folds too. Press Menu: panel links become native disclosures, the group holding the current route starts open, the reason on an unavailable link becomes visible text because a touch screen cannot hover, and both actions sit at the foot. Focus returns to the trigger on close.

fluid
Skip to content
AutoMindz Solutions

AutoMindz Solutions

The bar a client app wakes up with.

Page content sits under the bar. The panel opens over it and is never clipped, because the header owns no overflow of its own.

07

Logo and one action

The empty case: no links, so no drawer trigger and no panel machinery, and the single action stays in the bar at every width instead of hiding behind a menu that would hold nothing.

fluid
Skip to content

AutoMindz Solutions

The bar a client app wakes up with.

Page content sits under the bar. The panel opens over it and is never clipped, because the header owns no overflow of its own.