
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
@chakra-ui/checkbox
Advanced tools
@chakra-ui/checkbox is a component library for creating accessible and customizable checkbox components in React applications. It is part of the Chakra UI library, which provides a set of accessible, reusable, and composable React components.
Basic Checkbox
This feature allows you to create a basic checkbox component. The Checkbox component can be used to render a simple checkbox with a label.
import { Checkbox } from '@chakra-ui/react';
function BasicCheckbox() {
return <Checkbox>Checkbox</Checkbox>;
}
Checkbox Group
This feature allows you to create a group of checkboxes. The CheckboxGroup component helps manage the state of multiple checkboxes and can be used to render a group of checkboxes with a shared color scheme and default values.
import { Checkbox, CheckboxGroup } from '@chakra-ui/react';
function CheckboxGroupExample() {
return (
<CheckboxGroup colorScheme="green" defaultValue={['one', 'two']}>
<Checkbox value="one">One</Checkbox>
<Checkbox value="two">Two</Checkbox>
<Checkbox value="three">Three</Checkbox>
</CheckboxGroup>
);
}
Indeterminate Checkbox
This feature allows you to create an indeterminate checkbox. The useCheckbox hook can be used to manage the state of the checkbox and set it to an indeterminate state.
import { Checkbox, useCheckbox } from '@chakra-ui/react';
function IndeterminateCheckbox() {
const { getCheckboxProps, getInputProps } = useCheckbox({
isIndeterminate: true,
});
return (
<Checkbox {...getCheckboxProps()}>
<input {...getInputProps()} />
Indeterminate Checkbox
</Checkbox>
);
}
react-checkbox-group is a lightweight library for managing groups of checkboxes in React. It provides a simple API for creating and managing checkbox groups, but it lacks the built-in accessibility and styling options provided by @chakra-ui/checkbox.
rc-checkbox is a React component for creating checkboxes. It offers basic checkbox functionality and customization options, but it does not provide the same level of accessibility and theming support as @chakra-ui/checkbox.
react-final-form is a form state management library for React. It includes components for creating and managing checkboxes within forms. While it offers powerful form management capabilities, it is more complex and not as focused on styling and accessibility as @chakra-ui/checkbox.
Checkbox component is used in forms when a user needs to select multiple values from several options.
yarn add @chakra-ui/checkbox
# or
npm i @chakra-ui/checkbox
import { Checkbox } from "@chakra-ui/checkbox"
<Checkbox>This is a checkbox</Checkbox>
CheckboxGroup is used to bind multiple checkboxes into a group, and it indicates whether one or more options are selected.
<CheckboxGroup defaultValue={["one", "two"]}>
<Checkbox value="one">One</Checkbox>
<Checkbox value="two">Two</Checkbox>
<Checkbox value="three">Three</Checkbox>
</CheckboxGroup>
FAQs
A React Checkbox component for use in forms
The npm package @chakra-ui/checkbox receives a total of 322,704 weekly downloads. As such, @chakra-ui/checkbox popularity was classified as popular.
We found that @chakra-ui/checkbox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.