Gathering detailed insights and metrics for react-mm-jsr
Gathering detailed insights and metrics for react-mm-jsr
Gathering detailed insights and metrics for react-mm-jsr
Gathering detailed insights and metrics for react-mm-jsr
npm install react-mm-jsr
Typescript
Module System
Node Version
NPM Version
58.7
Supply Chain
92.7
Quality
74.9
Maintenance
100
Vulnerability
80.6
License
TypeScript (61.37%)
Svelte (20.52%)
HTML (6.96%)
JavaScript (5.79%)
CSS (5.36%)
Total Downloads
785
Last Day
4
Last Week
4
Last Month
9
Last Year
103
56 Stars
512 Commits
16 Forks
5 Watching
4 Branches
5 Contributors
Latest Version
2.0.4
Package Id
react-mm-jsr@2.0.4
Unpacked Size
5.98 kB
Size
3.05 kB
File Count
6
NPM Version
6.14.12
Node Version
14.16.1
Cumulative downloads
Total Downloads
Last day
0%
4
Compared to previous day
Last week
300%
4
Compared to previous week
Last month
80%
9
Compared to previous month
Last year
-25.4%
103
Compared to previous year
22
Official adapter for mm-jsr. Visit link for more information about library.
mm-jsr provides You with excellent solution for creating so-called range-inputs.
Range input is form's field where one can choose a value from min-max range. Although HTML 5 comes with input[type="range"] its functionality lacks a lot of features. mm-jsr gives You anything You may need.
npm install --save mm-jsr react-mm-jsr
or
yarn add mm-jsr react-mm-jsr
(it is also available in unpkg with variable name ReactJSR
. Remember to include mm-jsr
(JSR) as well)
Add CSS (you can use basic styles from here)
Instantiate (see docs for more information about configuration and modules)
1import JSR from 'mm-jsr'; 2import { useJSR } from 'react-mm-jsr'; 3 4function MyComponent () { 5 const { ref: jsrRef, instance: jsrInstance } = useJSR({ 6 modules: [ 7 new JSR.Rail(), 8 new JSR.Slider(), 9 new JSR.Bar(), 10 new JSR.Label(), 11 ], 12 config: { 13 min: 0, 14 max: 100, 15 step: 1, 16 initialValues: [25, 75], 17 }, 18 }); 19 20 return (<div ref={jsrRef} />); 21}
instance
returned from useJSR
is not available immediately, because JSR mounts itself after component.
Underhood it uses useState
for storing instance.
Therefore each usage must check for instance existence, and usage in hooks have to use instance as dependency.
To handle onValueChange you may use this code
1useEffect(() => { 2 if (jsrInstance) { 3 return jsrInstance.onValueChange(console.log); 4 } 5}, [jsrInstance]);
As onValueChange
returns function, that will unsubscribe the handler, it can be used naturally with React's useEffect
.
Because you mount JSR by using ref
, you have full control over JSR parent element.
So by applying class to that element, and then wrapping default styles with applied class, you can have styled and scoped JSR.
The same works for styled-components
:
1const JsrContainer = styled.div` 2 display: block; 3 position: relative; 4 padding-top: 10px; 5 width: 100%; 6 ... 7 8 .jsr_rail { 9 height: 5px; 10 background: #444; 11 } 12 13 ... 14`;
NOTE: .jsr
class is the container element itself.
NOTE: .jsr_lockscreen
is applied to body, so it should be global.
See docs on locking screen on touchevent for more info.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
21 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More