
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@pearson-ux/range-slider
Advanced tools
A shareable, accessible input range slider
https://pearson-ux.github.io/web-components/range-slider/
Run the following in your terminal:
# my-app is the directory containing your app
cd my-app
npm install --save @pearson-ux/range-slider
Import the web component onto the page, inbetween the <head>
tags, like so:
<head>
<!-- Polyfills -->
<script type="text/javascript">
if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
document.write('<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.2.0/webcomponents-loader.js"><\/script>');
document.write('<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.2.0/custom-elements-es5-adapter.js"><\/script>');
} else {
document.write('<script src="https://unpkg.com/@webcomponents/webcomponentsjs@^2/webcomponents-loader.js"><\/script>');
document.write('<script src="https://unpkg.com/@webcomponents/webcomponentsjs@^2/custom-elements-es5-adapter.js"><\/script>');
}
</script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<!-- Web component script -->
<script src="path/to/pearson-range-slider.js"></script>
</head>
Important Notes:
Add the pearson-range-slider
open and closing tags to the page.
All attributes in this API are optional.
Attribute | Type | Default | Description |
---|---|---|---|
min | Bool | unset | Set the minimum number of the slider. |
max | String | unset | Set the maximum number of the slider |
step | String | unset | The stepping interval |
toptext | String | unset | Text that is centered above the slider |
righttext | String | unset | Text that is to the right of the slider |
input | Bool | BOOL | Setting to true, adds an optional input box to control the slider |
bottomtext | String | unset | Text that is below the input |
Event | Description |
---|---|
change | Will fire when the range-slider drags across the bar or when an input value is entered. |
To use these web components in your react application do the following. First install the component.
npm install --save @pearson-ux/range-slider
Import your component on the page you would like to use it on
import "@pearson-ux/range-slider";
Then use the markup in your JSX code. You can pass props in to available API attributes.
render () {
return (
<div>
<pearson-range-slider min="0" max="5" step="any" toptext="Target Weight" bottomtext="" righttext="lb"></pearson-range-slider>
</div>
)
}
FAQs
Input range slider web component
We found that @pearson-ux/range-slider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.