Foundation and layout
SkipLink
Keyboard shortcut to the primary page content.
Live example
Focus this frame, then press Tab.
Skip to preview content
Preview content target
Focus this frame, then press Tab.
Skip to preview content
Preview content target
Focus this frame, then press Tab.
Skip to preview content
Preview content target
Usage
Each example includes the complete adapter-specific parameter reference. Copy it as a starting point, then remove options your use case does not need.
React
import { SkipLink } from "@cofob/design-system-react";
/**
* Complete SkipLink parameter reference.
* @param targetId/href
* type: string
* default: "main-content" / "#main-content"
* example: "main-content" / "#main-content"
* @param children
* type: ReactNode | Svelte Snippet | child HTML
* default: —
* example: children / snippet / child HTML
* @param anchor attributes
* type: native element attributes
* default: —
* example: class / style / aria-* / data-*
*/
export function SkipLinkExample() {
return (
<SkipLink targetId="content" />
);
}Svelte
<script lang="ts">
import { SkipLink } from "@cofob/design-system-svelte";
// Complete SkipLink parameter reference.
// targetId/href
// type: string
// default: "main-content" / "#main-content"
// example: "main-content" / "#main-content"
// children
// type: ReactNode | Svelte Snippet | child HTML
// default: —
// example: children / snippet / child HTML
// anchor attributes
// type: native element attributes
// default: —
// example: class / style / aria-* / data-*
</script>
<SkipLink targetId="content" />HTML
<!--
Complete SkipLink parameter reference.
targetId/href
type: string
default: "main-content" / "#main-content"
example: "main-content" / "#main-content"
children
type: ReactNode | Svelte Snippet | child HTML
default: —
example: children / snippet / child HTML
anchor attributes
type: native element attributes
default: —
example: class / style / aria-* / data-*
-->
<a class="cf-skip-link" href="#content">Skip to content</a>
<script type="module">
import { initDesignSystem } from "@cofob/design-system-css";
const designSystem = initDesignSystem(document);
window.addEventListener("pagehide", () => designSystem.destroy(), { once: true });
</script>Parameters
Adapter differences are explicit. Native element attributes are forwarded in React and Svelte and can be written directly in HTML.
| Parameter | Type | Default | Adapters | Example | Description |
|---|---|---|---|---|---|
targetId/href | string | "main-content" / "#main-content" | React · Svelte · HTML | "main-content" / "#main-content" | Main content destination; React accepts an ID, while Svelte and HTML accept an href. |
children | ReactNode | Svelte Snippet | child HTML | — | React · Svelte · HTML | children / snippet / child HTML | Idiomatic adapter composition content. |
anchor attributes | native element attributes | — | React · Svelte · HTML | class / style / aria-* / data-* | Forwards native class/style, accessibility, event, and data attributes to the root element. |