BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/@nswds/ui/mobile-nav

Mobile Navigation Drawer

nswds-ui/mobile-nav
FreeBlock

Hamburger trigger opening a left-side sheet containing the multi-level push menu — the mobile navigation pattern for NSW site headers.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/digitalnsw/nswds-ui/main/apps/registry/public/r/mobile-nav.json

Source

src/patterns/mobile-nav.tsxraw.githubusercontent.com/digitalnsw/nswds-ui/main/apps/registry/public/r/mobile-nav.json · first 6 KB
1'use client'
2
3import * as React from 'react'
4
5import { Button } from '@/components/button'
6import { PushMenu, type PushMenuItem } from '@/components/push-menu'
7import { Sheet, SheetContent, SheetTitle, SheetTrigger } from '@/components/sheet'
8import { IconMenu } from '@/icons/menu'
9
10export type MobileNavProps = {
11 /** The menu tree, passed straight to `PushMenu`. Item ids must be unique. */
12 navigation: PushMenuItem[]
13 /**
14 * The app's current pathname. Leaf links whose `href` matches get
15 * `aria-current="page"` and the active treatment (see `PushMenu`).
16 */
17 currentHref?: string
18 /**
19 * Drawer title: names the dialog for assistive tech (via a visually-hidden
20 * `SheetTitle`) and is shown by `PushMenu` as its root level heading.
21 * Defaults to `"Menu"`.
22 */
23 title?: string
24 /** Controlled open state. Leave unset for uncontrolled. */
25 open?: boolean
26 /** Initial open state when uncontrolled. Defaults to `false`. */
27 defaultOpen?: boolean
28 /**
29 * Fired whenever the drawer opens or closes — trigger click, Escape,
30 * backdrop click, the menu's own close button, and leaf-link clicks all
31 * funnel through here. Pair with `open` for a controlled drawer.
32 */
33 onOpenChange?: (open: boolean) => void
34 /** Extra drawer content rendered below the menu — a sign-in link, say. */
35 children?: React.ReactNode
36}
37
38/**
39 * Mobile navigation drawer: a hamburger button that opens a left-side sheet
40 * containing the multi-level `PushMenu`. A registry block — copy the source
41 * and adapt it — composed entirely from published components: `Button`
42 * (trigger), `Sheet` (the drawer, on the Base UI dialog primitive) and
43 * `PushMenu` (the drill-down menu).
44 *
45 * Accessibility contract:
46 *
47 * - Base UI's dialog provides the modal behaviour — focus trap, scroll lock,
48 * Escape and backdrop dismissal, and focus return to the trigger on close.
49 * Nothing is hand-rolled (the nswds-app source hand-assembled this from
50 * Headless UI Dialog + fixed-position divs).
51 * - The dialog's accessible name comes from a visually-hidden `SheetTitle`.
52 * It is `sr-only` because `PushMenu` already renders a visible title in its
53 * header row: a second visible "Menu" heading would duplicate it, but the
54 * per-level heading can't name the dialog either — it changes as the user
55 * drills, and it isn't wired to the popup's `aria-labelledby`. Same
56 * arrangement as sidebar-style sheets elsewhere in the shadcn ecosystem.
57// … truncated

What it pulls in

Other registry items

  • https://ui.digital.nsw.gov.au/registry/r/theme.json
  • https://ui.digital.nsw.gov.au/registry/r/button.json
  • https://ui.digital.nsw.gov.au/registry/r/sheet.json
  • https://ui.digital.nsw.gov.au/registry/r/push-menu.json
  • https://ui.digital.nsw.gov.au/registry/r/icons.json

Files it writes

  • src/patterns/mobile-nav.tsx

Facts

Registry
@nswds/ui
Type
registry:block
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-20
Last confirmed
today

Go to the source

ui.digital.nsw.gov.au digitalnsw/nswds-ui on GitHub Raw registry item This item as JSON

More from @nswds/ui

All 46 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Footer — Collapsible Site Mapfooter-accordion@nswds/uiBlocksFreeno deps
Footer — Compact Barfooter-compact@nswds/uiBlocksFreeno deps
Footer — Contact Detailsfooter-contact@nswds/uiBlocksFreeno deps
Footer — Call to Actionfooter-cta@nswds/uiBlocksFreeno deps
Footer — Newsletterfooter-newsletter@nswds/uiBlocksFreeno deps
Footer — Simple Centredfooter-simple-centred@nswds/uiBlocksFreeno deps
Footer — Site Mapfooter-sitemap@nswds/uiBlocksFreeno deps
Footer — Site Map with Brandfooter-sitemap-brand@nswds/uiBlocksFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored on what can be checked

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex