Skip link
Enables users to bypass repetitive navigation links and jump directly to the main content. It enhances accessibility for keyboard and screen reader users by improving navigation efficiency and is typically hidden until focused.
Where to use?
Every gov.my
page should have a skip link placed immediately after <body>
tab.
However if cookie banner is used, place skip links immediately after cookie banner.
If <header>
is present, wrap skip links inside header. Do not wrap skip links inside <nav>
.
- Skip link component which link to main content section ID.
- To add a focusable element in anywhere of the section or page just add tabindex=”0”.
How it works?
Skip link is hidden by default and only appear when user tap on TAB key on keyboard after page load. When it appears, it will be in a fixed position at the top left of the screen.
- When press TAB key on keyboard, skip links appear (instantly) in focus state. Additionally, add a Shadow/context-menu shadow to indicate that it is above other menus. Note: When click anywhere on the page, hide the skip link button.
- While skip link is in focus, press the ENTER key will hide the skip link button, scroll to the main content section, and focus on the first focusable element.
What if user continue to press TAB?
If the user continues to press TAB after the skip links button appears, the focus will move sequentially to the next interactive elements on the page, following the natural tab order.
- Focus on first focusable element (nav buttons).
- Focus on second focusable element and so on following natural tab order.
Demo
Press TAB → Enter
Skip to main content.
Press TAB → TAB → TAB ..
To focus on first focusable links (Usually the links in navbar).