
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@cagov/ds-content-navigation
Advanced tools
Page navigation lists and links to the level 2 headings (H2) of a webpage. It is placed at the top of the page on the left. People can select a link to go directly to that section. The links are introduced by the text **On this page** by default. The page
Page navigation lists and links to the level 2 headings (H2) of a webpage. It is placed at the top of the page on the left. People can select a link to go directly to that section. The links are introduced by the text On this page by default. The page navigation does not show if there are zero or one H2’s on the page.
Page navigation makes it easy to see what’s on a page. It allows people to scan a page and know if they’re in the right place.
Use this component on pages with two or more H2’s. You’ll probably use page navigation on most of your pages.
Do not use this component to replace or duplicate site navigation.
<cagov-content-navigation data-selector=".main" data-type="wordpress" data-label="On this page"></cagov-content-navigation>
| Property | Value |
|---|---|
| Machine name | ds-content-navigation |
| JavaScript | yes |
| SCSS | ./src/index.scss |
The instructions assume familiarity with npm package management tool, modern JavaScript techniques, and Sass.
npm i @cagov/[machine-name]import¹ or require to include the component’s *JavaScript** in your page or compiler.The following CSS variables are used in this component
--gray-300All CSS variables define their own fallback value so you do not have to use additional CSS unless you want to change them. You may define your own value for the variable by adding your own style rules. Here is an example defining the global hex value for a CSS variable named “—primary-color”:
:root {
--primary-color: #064e66;
}
nav tag) and has ARIA label (has aria-labelledby attribute).id attribute that is referenced in nav’s aria-labelledby attribute.—-highlight-color variable on focused state.Components in Alpha status must pass the following accessibility reviews every time a new version is published:
[axe](https://www.deque.com/axe/) accessibility tool and passes all automated WCAG Level AA checksComponents in Beta status must pass the following accessibility reviews every time a new version is published:
[axe](https://www.deque.com/axe/) accessibility tool and passes all automated WCAG Level AA checksThis component uses a custom element defined in JavaScript in addition to HTML and CSS. Edge, Firefox, Safari, and Chrome support custom elements. If the JavaScript for this component is not delivered or supported, the component will not display. This is the desired behavior because this component is not critical for site interaction. 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 | Description | Data type | Field type | Default |
|---|---|---|---|---|---|
| Label | data-label | Label for the page index | string | Plain text | “On this page” |
| Selector | data-selector | HTML selector to parse to locate H2 elements | string | Plain text | main |
| Editor type | data-type | Editor | string | Plain text | wordpress (currenly only supports WordPress) |
data-selector.Run: npm run start at the repository root to preview elements. This will launch local server with links to component demo pages.
The documentation is generated using the custom elements manifest schema draft standard analyzer command. Here is an example run outside the accordion directory:
wca analyze src --format json --outFile custom-elements.json
FAQs
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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.

Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.

Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.