{"bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"32afd1646a5d9933254370ebec45e4e7dd98db95","tarball":"https://registry.npmjs.org/@material/checkbox/-/checkbox-7.0.0-canary.8550fa53b.0.tgz","fileCount":40,"integrity":"sha512-oBpq3tBvbDk6ckQ/cOqMvDQFGjoU28xvEUKutENu2BL6+oq0+g6VP3Hw51Dbh3YnIAdYv1wHjlWGLwEhNOZLJA==","signatures":[{"sig":"MEYCIQDqlAF0gAlW3MHIVQq6IeItn5p1f0STxxhLXnnP6MKYDQIhAOQX33dXWr4SI4x1vJAKTo6x5+/TD7gg025ZiM9FY2Tw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":653625,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7Se0CRA9TVsSAnZWagAAk+MQAIfHCy1n/r4s+tKdXH/o\n18DIZfrFYxO9RYRddafyKDShYagx4rloYlVkVfgVsIWJYp4z4doi3f7lTegQ\n4q3iweTWYDJXlBevgms0QOdvl/LJ1TkKv1sINNL6uz0YCWUPtmaUmy+DEXJs\nIWkycvT7HJej86FRC+btWqRdQPkO5iuwzP+tRNya0irs7+oVQxsjXCeDJeh2\nN9wlTG5WbDgtcwd1y1+a3ZWSuh50OkdSSUOI8gF5FJ4r9WnK1oRk7qKawOhy\n8uFD3TIH/rHU5h57sdawKtmyIWUDCU7/7YU6mNOhGGaCn29oXgqkrHlp9tZv\nzKJlkgTL6giuCWs7YL8ljb6lk+vHnsV7BF8TIKBqmNz3bCkFSxvyCkH3+mOP\nnZ9vdPgoAXSoLG9dr4FRfTu4fXmuSlhYURJCFNF4F6kofh2C8DGdGvATLo2j\n0yxAUHHNulX37mXV/vIEPXxNtAq26qPdXCjiH+6DxNC/X9yvkT+8DLGckLPS\nF+ExIyGWH1jK3jmzSTk8UiB9c0yGqfyqWOHkuiJzyOrDCoey0ntsI+s2au89\ntmwBBX3IK0EZ8xqO9VLe6IiEZvKxji+2Fdtj55TvDg93wLbTFmlhBZ9RKIap\n1h7BcpYkYUrBz1GwoPAX6tfhzNfyUpQnzTGq2T7KidJT+ju3PmKFuWMw3PPk\nm9LB\r\n=ABqi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.checkbox.js","name":"@material/checkbox","types":"dist/mdc.checkbox.d.ts","module":"./index.js","readme":"<!--docs:\ntitle: \"Checkboxes\"\nlayout: detail\nsection: components\nexcerpt: \"Checkboxes allow the user to select multiple options from a set.\"\niconId: selection_control\npath: /catalog/input-controls/checkboxes/\n-->\n\n# Selection controls: checkboxes\n\n[Selection controls](https://material.io/components/selection-controls#usage) allow the user to select options.\n\nUse checkboxes to:\n\n* Select one or more options from a list\n* Present a list containing sub-selections\n* Turn an item on or off in a desktop environment\n\n![Checkbox hero example for menu options](images/checkbox-hero.png)\n\n## Contents\n\n* [Using checkboxes](#using-checkboxes)\n* [Checkboxes](#checkboxes)\n* [Other variants](#other-variants)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using checkboxes\n\nCheckboxes allow the user to select one or more items from a set. Checkboxes can be used to turn an option on or off.\n\n### Installing checkboxes\n\n```\nnpm install @material/checkbox\n```\n\n### Styles\n\n```scss\n@use \"@material/checkbox\";\n@use \"@material/form-field\";\n\n@include checkbox.core-styles;\n@include form-field.core-styles;\n```\n\n**Note: The form field styles are only required when the checkbox is used with the form field.**\n\n### JavaScript instantiation\n\nThe checkbox will work without JavaScript, but you can enhance it with a ripple interaction effect by instantiating `MDCCheckbox` on the `mdc-checkbox` element. To activate the ripple effect upon interacting with the label, you must also instantiate `MDCFormField` on the `mdc-form-field` element and set the `MDCCheckbox` instance as its `input`.\n\n```js\nimport {MDCFormField} from '@material/form-field';\nimport {MDCCheckbox} from '@material/checkbox';\n\nconst checkbox = new MDCCheckbox(document.querySelector('.mdc-checkbox'));\nconst formField = new MDCFormField(document.querySelector('.mdc-form-field'));\nformField.input = checkbox;\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making checkboxes accessible\n\nMaterial Design spec advises that touch targets should be at least 48px x 48px.\nTo meet this requirement, add the `mdc-checkbox--touch` class to your checkbox as follows:\n\n```html\n<div class=\"mdc-touch-target-wrapper\">\n  <div class=\"mdc-checkbox mdc-checkbox--touch\">\n    <input type=\"checkbox\"\n           class=\"mdc-checkbox__native-control\"\n           id=\"checkbox-1\"/>\n    <div class=\"mdc-checkbox__background\">\n      <svg class=\"mdc-checkbox__checkmark\"\n           viewBox=\"0 0 24 24\">\n        <path class=\"mdc-checkbox__checkmark-path\"\n              fill=\"none\"\n              d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n      </svg>\n      <div class=\"mdc-checkbox__mixedmark\"></div>\n    </div>\n    <div class=\"mdc-checkbox__ripple\"></div>\n  </div>\n</div>\n```\n\nNote that the outer `mdc-touch-target-wrapper` element is only necessary if you want to avoid potentially overlapping touch targets on adjacent elements (due to collapsing margins).\n\n## Checkboxes\n\nWe recommend using MDC Checkbox with [MDC Form Field](../mdc-form-field) for enhancements such as label alignment, label activation of the ripple interaction effect, and RTL-awareness.\n\n### Checkbox example\n\n```html\n<div class=\"mdc-form-field\">\n  <div class=\"mdc-checkbox\">\n    <input type=\"checkbox\"\n           class=\"mdc-checkbox__native-control\"\n           id=\"checkbox-1\"/>\n    <div class=\"mdc-checkbox__background\">\n      <svg class=\"mdc-checkbox__checkmark\"\n           viewBox=\"0 0 24 24\">\n        <path class=\"mdc-checkbox__checkmark-path\"\n              fill=\"none\"\n              d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n      </svg>\n      <div class=\"mdc-checkbox__mixedmark\"></div>\n    </div>\n    <div class=\"mdc-checkbox__ripple\"></div>\n  </div>\n  <label for=\"checkbox-1\">Checkbox 1</label>\n</div>\n```\n\n**Note: If you are using IE, you need to include a closing `</path>` tag if you wish to avoid console warnings.**\n\n### Checkbox states\n\nCheckboxes can be selected, unselected, or indeterminate. Checkboxes have enabled, disabled, hover, focused, and pressed states.\n\n![Checkbox states in a table. Columns are enabled, disabled, hover, focused, pressed. Rows are selected, unselected, or indeterminite](images/checkbox-states.png)\n\n## Other variants\n\n### Disabled checkboxes\n\nNote that `mdc-checkbox--disabled` is necessary on the root element of CSS-only checkboxes to prevent hover states from activating. Checkboxes that use the JavaScript component do not need this class; a `disabled` attribute on the `<input>` element is sufficient.\n\n```html\n<div class=\"mdc-checkbox mdc-checkbox--disabled\">\n  <input type=\"checkbox\"\n         id=\"basic-disabled-checkbox\"\n         class=\"mdc-checkbox__native-control\"\n         disabled />\n  <div class=\"mdc-checkbox__background\">\n    <svg class=\"mdc-checkbox__checkmark\"\n         viewBox=\"0 0 24 24\">\n      <path class=\"mdc-checkbox__checkmark-path\"\n            fill=\"none\"\n            d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n    </svg>\n    <div class=\"mdc-checkbox__mixedmark\"></div>\n  </div>\n  <div class=\"mdc-checkbox__ripple\"></div>\n</div>\n<label for=\"basic-disabled-checkbox\" id=\"basic-disabled-checkbox-label\">This is my disabled checkbox</label>\n```\n\n### Indeterminate checkboxes\n\nNote that `data-indeterminate=\"true\"` is necessary on the input element for initial render, or in a CSS-only mode. Checkboxes that use the Javascript component can modify the `indeterminate` property at runtime.\n\n```html\n<div class=\"mdc-checkbox\">\n  <input type=\"checkbox\"\n         id=\"basic-indeterminate-checkbox\"\n         class=\"mdc-checkbox__native-control\"\n         data-indeterminate=\"true\"/>\n  <div class=\"mdc-checkbox__background\">\n    <svg class=\"mdc-checkbox__checkmark\"\n         viewBox=\"0 0 24 24\">\n      <path class=\"mdc-checkbox__checkmark-path\"\n            fill=\"none\"\n            d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n    </svg>\n    <div class=\"mdc-checkbox__mixedmark\"></div>\n  </div>\n  <div class=\"mdc-checkbox__ripple\"></div>\n</div>\n<label for=\"basic-indeterminate-checkbox\" id=\"basic-indeterminate-checkbox-label\">This is my indeterminate checkbox</label>\n```\n\n## API\n\n### Sass mixins\n\nMDC Checkbox uses [MDC Theme](../mdc-theme)'s `secondary` color by default for \"marked\" states (i.e., checked or indeterminate).\n\nMixin | Description\n--- | ---\n`container-colors($unmarked-stroke-color, $unmarked-fill-color, $marked-stroke-color, $marked-fill-color, $generate-keyframes)` | Sets stroke & fill colors for both marked and unmarked state of enabled checkbox. Set $generate-keyframes to false to prevent the mixin from generating @keyframes.\n`disabled-container-colors($unmarked-stroke-color, $unmarked-fill-color, $marked-stroke-color, $marked-fill-color)` | Sets stroke & fill colors for both marked and unmarked state of disabled checkbox.\n`ink-color($color)` | Sets the ink color of the checked and indeterminate icons for an enabled checkbox\n`disabled-ink-color($color)` | Sets the ink color of the checked and indeterminate icons for a disabled checkbox\n`focus-indicator-color($color)` | Sets the color of the focus indicator (ripple) when checkbox is selected or is in indeterminate state.\n`ripple-size($ripple-size)` | Sets the ripple size of the checkbox.\n`density($density-scale)` | Sets density scale for checkbox, Supported density scales are `-3`, `-2`, `-1`, and `0` (default).\n\nThe ripple effect for the Checkbox component is styled using [MDC Ripple](../mdc-ripple) mixins.\n\n### `MDCCheckbox` properties and methods\n\nProperty Name | Type | Description\n--- | --- | ---\n`checked` | `boolean` | Setter/getter for the checkbox's checked state\n`indeterminate` | `boolean` | Setter/getter for the checkbox's indeterminate state\n`disabled` | `boolean` | Setter/getter for the checkbox's disabled state\n`value` | `string` | Setter/getter for the checkbox's\n\n## Usage within web frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Checkbox for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\n### `MDCCheckboxAdapter`\n\nMethod Signature | Description\n--- | ---\n`addClass(className: string) => void` | Adds a class to the root element.\n`removeClass(className: string) => void` | Removes a class from the root element.\n`forceLayout() => void` | Force-trigger a layout on the root element. This is needed to restart animations correctly. If you find that you do not need to do this, you can simply make it a no-op.\n`isAttachedToDOM() => boolean` | Returns true if the component is currently attached to the DOM, false otherwise.\n`isIndeterminate() => boolean` | Returns true if the component is in the indeterminate state.\n`isChecked() => boolean` | Returns true if the component is checked.\n`hasNativeControl() => boolean` | Returns true if the input is present in the component.\n`setNativeControlDisabled(disabled: boolean) => void` | Sets the input to disabled.\n`setNativeControlAttr(attr: string, value: string) => void` | Sets an HTML attribute to the given value on the native input element.\n`removeNativeControlAttr(attr: string) => void` | Removes an attribute from the native input element.\n\n### `MDCCheckboxFoundation`\n\nMethod Signature | Description\n--- | ---\n`setDisabled(disabled: boolean) => void` | Updates the `disabled` property on the underlying input. Does nothing when the underlying input is not present.\n`handleAnimationEnd() => void` | `animationend` event handler that should be applied to the root element.\n`handleChange() => void` | `change` event handler that should be applied to the checkbox element.\n","gitHead":"9d8529cbd579dccb2470a1f19fac57883cb2a5ef","license":"MIT","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"homepage":"https://github.com/material-components/material-components-web#readme","keywords":["material components","material design","checkbox"],"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-checkbox"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components for the web checkbox component","directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.8550fa53b.0","@material/base":"7.0.0-canary.8550fa53b.0","@material/theme":"7.0.0-canary.8550fa53b.0","@material/ripple":"7.0.0-canary.8550fa53b.0","@material/density":"7.0.0-canary.8550fa53b.0","@material/animation":"7.0.0-canary.8550fa53b.0","@material/touch-target":"7.0.0-canary.8550fa53b.0","@material/feature-targeting":"7.0.0-canary.8550fa53b.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/checkbox_7.0.0-canary.8550fa53b.0_1592600500107_0.6865173430930445","host":"s3://npm-registry-packages"},"_id":"@material/checkbox@7.0.0-canary.8550fa53b.0","version":"7.0.0-canary.8550fa53b.0"}