SkipLink + LiveRegion
AtomSkipLink is visually hidden until focused, enabling keyboard users to bypass navigation. LiveRegion announces dynamic content to screen readers.
Tab into the area below to reveal the skip link:
Skip to main content
Main content area
<%# Place at top of layout: %>
<%- include('modules/ui/SkipLink', { href: '#main-content' }) %>
<%# Linked target: %>
<main id="main-content">...</main>
(screen reader hears: "Announcement #1 sent")
Announcement #1 sent
<%# Polite live region — announces `message` to screen readers %>
<div role="status" aria-live="polite" aria-atomic="true" class="sr-only">
<%= message %>
</div>
<%
var _href = locals.href || '#main-content';
var _label = locals.label || 'Skip to main content';
var _className = locals.className || '';
%>
<a
href="<%= _href %>"
class="sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-[100] px-4 py-2 rounded-md text-sm font-medium bg-primary text-primary-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus<%= _className ? ' ' + _className : '' %>"
>
<%= _label %>
</a>