Examples
Basic
The link is visually hidden until focused. Tab into the example to make it appear.
Documentation
Skip to content props
Parameters accepted by
{#include components/navigation/skip-to-content ... /}. Model mode: pass
skipToContent=<SkipToContent> built in Java instead — the Java tab on each
example shows the builder.
| Name | Type | Description |
|---|---|---|
* id
|
String | DOM id. |
* href
|
String |
Target id to jump to (typically #main-content).
|
| (content slot) | Slot |
Visible link label, passed as the include body. Defaults to
"Skip to content" when the body is empty.
|
Usage
Place first. The skip link must be the very first focusable element in the page — before the masthead, before any nav. PF v6's CSS keeps it visually hidden until it receives focus.
Add tabindex to the target. Set tabindex="-1" on the destination
element so focus can land there programmatically.