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
Content
Without the skip link, a keyboard user tabs through every navigation link to get here.
skip-link-demo.tsxCopy code
Installation
Copy code
Usage
ImportCopy code
API reference
SkipLink
| Prop | Type | Default |
|---|---|---|
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 SkipLinkPropsAccessibility
- 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.