Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rmwc/checkbox

Package Overview
Dependencies
Maintainers
1
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rmwc/checkbox - npm Package Compare versions

Comparing version 14.0.4 to 14.0.5

16

package.json
{
"name": "@rmwc/checkbox",
"version": "14.0.4",
"version": "14.0.5",
"description": "RMWC Checkbox component",

@@ -40,4 +40,2 @@ "main": "./index.js",

"peerDependencies": {
"@material/checkbox": "^14.0.0",
"@material/form-field": "^14.0.0",
"react": ">=16.8.x",

@@ -47,8 +45,10 @@ "react-dom": ">=16.8.x"

"dependencies": {
"@rmwc/base": "14.0.4",
"@rmwc/formfield": "14.0.4",
"@rmwc/ripple": "14.0.4",
"@rmwc/toggleable": "14.0.4",
"@rmwc/types": "14.0.4"
"@material/checkbox": "^14.0.0",
"@material/form-field": "^14.0.0",
"@rmwc/base": "14.0.5",
"@rmwc/formfield": "14.0.5",
"@rmwc/ripple": "14.0.5",
"@rmwc/toggleable": "14.0.5",
"@rmwc/types": "14.0.5"
}
}
# Checkboxes
> Checkboxes allow the user to select multiple options from a set.
Checkboxes allow the user to select multiple options from a set.

@@ -8,71 +8,57 @@ - Module **@rmwc/checkbox**

- Using CSS Loader
- import **'@rmwc/checkbox/styles';**
- import '@rmwc/checkbox/styles';
- Or include stylesheets
- **'@material/checkbox/dist/mdc.checkbox.css'**;
- **'@material/form-field/dist/mdc.form-field.css'**;
- **'@material/ripple/dist/mdc.ripple.css'**;
- **'@material/checkbox/dist/mdc.checkbox.css'**
- **'@material/form-field/dist/mdc.form-field.css'**
- **'@material/ripple/dist/mdc.ripple.css'**
- MDC Docs: [https://material.io/develop/web/components/input-controls/checkboxes/](https://material.io/develop/web/components/input-controls/checkboxes/)
Controlled
```js
```jsx
function Example() {
const \[checked, setChecked\] \= React.useState(false);
const [checked, setChecked] = React.useState(false);
return (
<Checkbox
label\="Cookies"
checked\={checked}
onChange\={(evt) \=> setChecked(!!evt.currentTarget.checked)}
label="Cookies"
checked={checked}
onChange={(evt) => setChecked(!!evt.currentTarget.checked)}
/>
);
}
```
```jsx
<Checkbox label="Pizza" />
```
Uncontrolled
```js
<Checkbox label\="Pizza" />
```jsx
<Checkbox>Icecream</Checkbox>
```
Label as Child
```jsx
<>
<Checkbox label="Broccoli" indeterminate />
```js
<Checkbox\>Icecream</Checkbox\>
<Checkbox label="Always On" checked />
<Checkbox label="Always Off" checked={false} />
</>
```
States
## Checkbox
A Checkbox component.
```js
### Props
<\>
| Name | Type | Description |
|------|------|-------------|
| `checked` | `boolean` | Toggle the control on and off. |
| `disabled` | `boolean` | Disables the control. |
| `foundationRef` | `Ref<MDCCheckboxFoundation<>>` | Advanced: A reference to the MDCFoundation. |
| `id` | `string` | A DOM ID for the toggle. |
| `indeterminate` | `boolean` | Make the control indeterminate |
| `inputRef` | `Ref<HTMLInputElement<>>` | A reference to the native input. |
| `label` | `ReactNode` | A label for the control. |
| `ripple` | `RipplePropT` | Adds a ripple effect to the component |
| `rootProps` | `HTMLProps<any>` | By default, all props except className and style spread to the input. These are additional props for the root of the checkbox. |
| `value` | `string \| number \| string[]` | The value of the control. |
<Checkbox label\="Broccoli" indeterminate />
<Checkbox label\="Always On" checked />
<Checkbox label\="Always Off" checked\={false} />
</\>
```
## Checkbox
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc