Skip link
A link to the main content that appears on keyboard focus, as the first thing in the body.
Native .astro · no React · MIT · free, no account
Install
npx shadcn@latest add https://www.themes.dev/astro/r/skip-link.jsonThe CLI needs a components.json (from npx shadcn init), which also writes the tokens these files use. No CLI? Copy the files below to the same paths.
Files
---// The first thing in <body>: a link to the main content that appears when it gets keyboard focus.// <SkipLink /> … <main id="main" tabindex="-1">interface Props { target?: string; label?: string;}const { target = 'main', label = 'Skip to content' } = Astro.props;--- <a href={`#${target}`} class="fixed top-3 left-3 z-50 inline-flex h-9 -translate-y-16 items-center rounded-md bg-background px-3 text-sm font-medium shadow-md outline-none ring-ring/50 transition-transform focus:translate-y-0 focus-visible:ring-3"> {label}</a>More for navigation
- BreadcrumbsFreeWhere the page sits, as links, with the BreadcrumbList structured data. The current page carries aria-current.Breadcrumbs.astro
- PaginationFreeNumbered pages with previous and next for an archive from paginate(). 36px controls, gaps as an ellipsis.Pagination.astro
- Table of contentsFreeOn this page: links to the h2 and h3 of an article, from Markdown headings or Portable Text.Toc.astro · headings.ts