Skip to content
Eskais UI

Navigation

Skip Link

A link to the main content that stays hidden until it takes keyboard focus, then floats at the top start of the viewport above everything else.

Example

Click inside the frame below, then press Tab: the skip link appears at its top corner. Press Enter on it to jump past the navigation.

Skip to content

Installation

npx shadcn@latest add @eskais/skip-link

Usage

Import
import { SkipLink } from "@/components/ui/skip-link"

API reference

PropTypeDefault
childrenrequiredThe link text, in the page's language, like "Skip to content".ReactNode–
targetThe element to focus: an id, or a ref. Defaults to the id in `href`, then `"main"`. Activating the link focuses it and scrolls it into view without changing the URL, so hash routers keep their route.string | RefObject<HTMLElement | null>–

Also takes <a> attributes except children, target.

Other exports

type SkipLinkProps

Accessibility

  • Hidden until it takes keyboard focus, then shows at the top of the viewport.
  • Points at #main by default.

Agent actions

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.