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.
@createnl/grouped-checkboxes
Advanced tools
An easy to use React Component to create a checkbox group with a checkbox to check all checkboxes.
npm install --save @createnl/grouped-checkboxes
yarn add @createnl/grouped-checkboxes
import React from "react";
import { AllCheckerCheckbox, Checkbox, CheckboxGroup } from 'grouped-checkboxes';
const MyGroupedCheckboxes = (props) => {
const onCheckboxChange = (checkboxes) => {
console.log(checkboxes);
}
return (
<CheckboxGroup onChange={onCheckboxChange}>
<AllCheckerCheckbox id="check-all" />
<Checkbox id="first-option" />
<Checkbox id="second-option" />
<Checkbox id="third-option" />
</CheckboxGroup>
);
};
Note that:
Checkbox
and AllCheckerCheckbox
must be inside a CheckboxGroup
AllCheckerCheckboxes
inside a grouponChange
callback on groupCheckbox
you can do to an input
component<CheckboxGroup defaultChecked> // Set defaultChecked to check all by default
<AllCheckerCheckbox id="check-all" checked/> // Error: You cant contol allCheckerCheckboxes individually (will check automatically if necessary)
<Checkbox id="first-option" checked/> // Check individual checkboxes
</CheckboxGroup>
<CheckboxGroup defaultDisabled> // Set defaultDisabled to disable all by default
<AllCheckerCheckbox id="check-all" disabled/> // Disable allCheckerCheckbox, will still check if all checkboxes are checked
<Checkbox id="first-option" disabled/> // Disable individual checkboxes
</CheckboxGroup>
import React from "react";
import { AllCheckerCheckbox, Checkbox, CheckboxGroup } from 'grouped-checkboxes';
const PermissionsFrom = (props) => {
const onCheckboxChange = (checkboxes) => {
console.log(checkboxes);
}
return (
<CheckboxGroup onChange={console.log}>
<label>
<Checkbox id="tos" />
Terms and Conditions
</label>
<label>
<Checkbox id="privacy-policy" />
Privacy Policy
</label>
<label>
<Checkbox id="advertisements" />
Advertisements
</label>
<label>
<AllCheckerCheckbox id="check-all" />
Agree to all
</label>
</CheckboxGroup>
);
};
The value of an onChange parameter looks like:
[
{
"checked": true,
"disabled": false,
"id": "tos",
},
{
"checked": true,
"disabled": false,
"id": "privacy-policy"
},
{
"checked": true,
"disabled": false,
"id": "advertisements"
}
]
All given props will be accessible.
FAQs
Grouped checkboxes with check-all checkboxes
The npm package @createnl/grouped-checkboxes receives a total of 163 weekly downloads. As such, @createnl/grouped-checkboxes popularity was classified as not popular.
We found that @createnl/grouped-checkboxes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.