
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
@cagov/ds-skip-to-content
Advanced tools
The skip to content component is an accessibility feature required on every page. It allows people to jump to the main content below the statewide header and the navigation.
The skip to content component is an accessibility feature required on every page. It allows people to jump to the main content below the statewide header and the navigation.
Skip to content is used by people who tab through navigation or use screen readers. It does not appear for other users.
Always use skip to content.
Do not modify skip to content when you install it.
<!-- Sample markup begins here. -->
<div id="skip-to-content">
<a href="#body-content-demo">Skip to content</a>
</div>
<!-- Sample markup ends here. -->
<!-- The following mark-up is strictly for demonstration purposes. -->
<p>To preview this accessibility feature, try the following.</p>
<ol>
<li>Click on the above "Demo and sample markup" heading.</li>
<li>Press the tab button on your keyboard.</li>
<li>The "Skip to content" link should appear at the top of this preview.</li>
<li>Click it.</li>
</ol>
<div id="body-content-demo">
<p>The page will scroll to this paragraph.</p>
</div>
Property | Value |
---|---|
Machine name | ds-skip-to-content |
JavaScript | no |
SCSS | ./src/index.scss |
The instructions assume familiarity with npm package management tool and Sass.
template.html
file just after the opening body tag of your HTML.id="body-content"
to the HTML tag at the top of the main content of the page.We recommend using a build system and bundling your CSS for faster performance. If you do not use a build system, you can include the code from our CDN with a link tag.
<link rel="stylesheet" href="https://cdn.designsystem.webstandards.ca.gov/components/ds-skip-to-content/v2.0.1/dist/index.css">
--accent2-500
variable.href=”#body-content”
is matching actual id
attribute in main content div.As a component in Alpha status, this component must pass the following accessibility reviews every time a new version is published:
This is an HTML- and CSS-only component. JavaScript is not required. It uses CSS variables to inherit design token values. Token definitions are not required because these style rules provide fallback values.
This component uses the following data attributes. We provide this information to help with integrating the component into backend publishing systems or identifying content that may require translation.
Name | Attribute name | Data type | Field type | Selector | Default value |
---|---|---|---|---|---|
Label | skip-to-content | string | Plain text | #skip-to-content a#body-content | Skip to content |
FAQs
The skip to content component is an accessibility feature required on every page. It allows people to jump to the main content below the statewide header and the navigation.
We found that @cagov/ds-skip-to-content demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.