Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@cagov/ds-back-to-top
Advanced tools
The back to top button lets people go back to the top of a page without scrolling. This can be helpful on long pages. When selected, the back to top button takes you to the top of the page.
The back to top button lets people go back to the top of a page without scrolling. This can be helpful on long pages. When selected, the back to top button takes you to the top of the page.
This can help people with mobility issues navigate the page more easily. It also helps people save time.
The back to top button is especially helpful for people using mobile devices. It decreases the swiping they have to do to get back to the top of a page.
The button appears when the user has scrolled past the first screen and begins to scroll back up. It disappears after 7 seconds by default. If someone scrolls again, it will reappear. If the user reaches the top of the page at any point, the button will disappear right away.
We recommend installing the back to top button by default. If a page is not long enough to require scrolling, the back to top button will not appear.
This component has no extra guidance. Use the component as specified.
The back to top component is integrated into this site and appears at the bottom right of the screen during a pause in scroll activity if you have scrolled down past the first screen and have begun to scroll back up.
<cagov-back-to-top data-hide-after="7000" data-label="Back to top">
</cagov-back-to-top>
Property | Value |
---|---|
Machine name | ds-back-to-top |
JavaScript | yes |
SCSS | ./src/index.scss |
The instructions assume familiarity with npm package management tool, modern JavaScript techniques, and Sass.
npm i @cagov/ds-back-to-top
import
¹ or require
to include the component’s JavaScript in your page or compiler.We recommend using a build system and bundling your JavaScript for faster performance. If you do not use a build system, you can include the code from our CDN with a script tag.
<script type="module" src="https://cdn.designsystem.webstandards.ca.gov/components/ds-back-to-top/v2.0.3/dist/index.js"></script>
The following CSS variables are used in this component:
--primary-700
--primary-900
--accent2-500
--font-size-2
--font-size-1
All 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-700”:
:root {
--primary-700: #165ac2;
}
aria-hidden=”true”
attribute.aria-hidden=”true”
and tabindex=”-1”
attributes. When button is visible, make sure those attribute are no longer there.--accent2-500
variable on focused state.As a component in Alpha status, this component 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 | Data type | Field type |
---|---|---|---|
Label | data-label | string | Plain text (default is “Back to top”) |
Hide after | data-hide-after | string | Integer (milliseconds, default is 7000) |
FAQs
The back to top button lets people go back to the top of a page without scrolling. This can be helpful on long pages. When selected, the back to top button takes you to the top of the page.
The npm package @cagov/ds-back-to-top receives a total of 54 weekly downloads. As such, @cagov/ds-back-to-top popularity was classified as not popular.
We found that @cagov/ds-back-to-top demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.