Dev Helpers
← Back

Layout with skip link

Place this file at app/studio/layout.tsx in an App Router project.

Open this example in the interactive library

Source code

// app/studio/layout.tsx

import type { ReactNode } from "react";

import Link from "next/link";

export default function LayoutWithSkipLink({ children }: { children: ReactNode }) {
  return (
    <>
      <a href="#studio-main">Skip to content</a>
      <nav>
        <Link href="/studio">Studio</Link>
      </nav>
      <main id="studio-main" tabIndex={-1}>
        {children}
      </main>
    </>
  );
}