apps/design-system/content/docs/fragments/skip-to-content.mdx
Keyboard-accessible skip link composed from Button for apps with persistent header and sidebar chrome. Hidden until focused via Tab, then slides into view so users can jump past navigation to the main landmark.
The preview above shows the focused appearance. In product apps, the link stays off-screen until keyboard focus.
See Accessibility for more information on when to use skip links, and how they coexist alongside other navigation aids.
import { SkipToContent } from 'ui-patterns/SkipToContent'
<SkipToContent href="#main" />
<main id="main" tabIndex={-1} className="scroll-mt-(--header-height) outline-hidden">
{children}
</main>
Place the skip link at the root of the app chrome so Tab reaches it before navigation. The target landmark must be content only. Do not wrap a sidebar inside the same <main>, otherwise a Tab after skip will land in the sidebar navigation.
hrefHash href to the main content landmark, e.g. #main.
childrenLink label. Defaults to Skip to content.
classNameOptional classes merged onto the positioning wrapper (useful for demos or layout overrides).
Callers own the landmark the skip link points at:
idtabIndex={-1} so Enter moves focus onto the landmarkscroll-mt when a sticky header is presentoutline-hidden so the landmark has no visible focus ring. The subsequent Tab will land on the first interactive child