Landmarks
shadcn-htmx/landmarksFreeComponent
An accessible page-shell from the native HTML landmark elements (header, nav, search, main, aside, section, footer). Thin semantic wrappers that expose the matching ARIA landmark role, with aria-label/aria-labelledby where the APG Landmarks practice requires a unique name. Zero JS.
Live preview
live · rendered by the registry
Rendered by shadcn-htmx on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://shadcn-htmx.productdevbook.com/r/landmarks.jsonSource
1/** @jsxImportSource hono/jsx */2import type { PropsWithChildren, Child } from "hono/jsx"3import { cn, type ClassValue } from "@/registry/lib/cn"45// Landmarks — shadcn-htmx, htmx v4 + Tailwind v4.6//7// An accessible page-shell built from the native HTML landmark elements.8// Pure structure — no JS. Each subcomponent is a thin semantic wrapper9// around the native element that implicitly exposes the matching ARIA10// landmark role, so assistive-tech users can jump between the major11// regions of the page.12//13// Native element → implicit landmark role14// <header> (in body context) → banner15// <nav> → navigation16// <search> → search17// <main> → main18// <aside> → complementary19// <section> (when labelled) → region20// <form> (when labelled) → form21// <footer> (in body context) → contentinfo22//23// Labelling rules (when to pass an aria-label / aria-labelledby) come24// straight from the APG. Several landmark roles must (region) or should25// (navigation, complementary, search) carry a unique label so multiple26// landmarks of the same type are distinguishable.27//28// APG (read for the per-role design patterns + labelling rules):29// repos/aria-practices/content/patterns/landmarks/examples/banner.html30// repos/aria-practices/content/patterns/landmarks/examples/navigation.html31// repos/aria-practices/content/patterns/landmarks/examples/main.html32// repos/aria-practices/content/patterns/landmarks/examples/complementary.html33// repos/aria-practices/content/patterns/landmarks/examples/region.html34// repos/aria-practices/content/patterns/landmarks/examples/search.html35// repos/aria-practices/content/patterns/landmarks/examples/contentinfo.html36// MDN (the native <search> element defines a search landmark — no role=search needed):37// repos/mdn/files/en-us/web/html/reference/elements/search/index.md:20-223839type LandmarkProps = PropsWithChildren<40 {41 class?: ClassValue42 id?: string43 // The accessible name for this landmark. Where the APG calls for one44 // (navigation, complementary, search when there is more than one; and45 // always for region) pass either ariaLabel or ariaLabelledby.46 ariaLabel?: string47 ariaLabelledby?: string48 } & Record<string, any>49>5051// <header> in body context = banner landmark. Top-level only: a <header>52// … truncated
More from shadcn-htmx
All 83 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | shadcn-htmx | Components | Free | no deps | |
| Active Searchactive-search | shadcn-htmx | Components | Free | no deps | |
| Alertalert | shadcn-htmx | Components | Free | no deps | |
| Alert Dialogalert-dialog | shadcn-htmx | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | shadcn-htmx | Components | Free | no deps | |
| Auto Gridauto-grid | shadcn-htmx | Components | Free | no deps | |
| Autocompleteautocomplete | shadcn-htmx | Components | Free | no deps | |
| Autosize Textareaautosize-textarea | shadcn-htmx | Components | Free | no deps |
