{"bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"471451dfb467c405e3e5efc922e8985d8263d4fb","tarball":"https://registry.npmjs.org/@material/radio/-/radio-12.0.0-canary.70e1efdca.0.tgz","fileCount":42,"integrity":"sha512-thMHdvLFrZHuevC1CeamszZxIPyucOtU7biCwxsHDnbWRysD2EBu/cI1RcmN7tjX3gIHw/ISpzA5eojoen29gQ==","signatures":[{"sig":"MEUCIQDq0rItQ41xWT2tGpu2KPxTQZdqOQ9Z6A1k4arkIYiYrQIgSc7rA2P8y5SkFUUjwbkHIg/e5z/WZe5wib43iz2CmQM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":549288,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3fYMCRA9TVsSAnZWagAAfnkQAJNMdoX3d7uds5v3TGXS\nU/6mY/HlEDEEu9OXvF0yLr0eriqlYadO5O4MsHUiNCIJapMI2AEddSVenvCE\nk0PHeZ852U4/vjlhEhrK1OqiOb6r2MHxP453oIyT94FXNIB0D/lbVi3QGwI8\n41iasnre0v3NXFQuqMK16oALRli+Ew2dgxCtmsdBfv6r8+XTw8cKFxzvBlm0\nQbLZWmzGQuVTu65+DzCof0BKK2em8+WU7J98o5qV29rvCehFxR5CixrIcLFA\n3OLHNiE9tYAfvhGF4R1Tz8Pe9AMgPc/vvZSBVRRRRtCaZQC1lvYWyRvRIAoU\nRohAa+m+0BTIX391NV/4PKSCQZrb76YEjGMqK652bnUar4frE6C3uDLH5KTQ\nEn9mMYNTLRCQvC/LbYbwjL6ZbloMI0gLa2qQMaL1aR7bXQuXgCj+MIPk7GnK\n+jVk/HgifyxOnpVT6WR+ePq5FH0nuUWSqsn45o+7fg/b/W2nDfSKkln3p/2O\nJhGS2DyhFnoZy/NATiMToRJxUy4GRgGO4293VeuHjJ49lR6WtB7AHyGSgJE4\n5V5bd/ucGnq2RM1tqPe1Og33gPWJGQQ6EJUBGzYmix/6R2o4fQ7KGWXkKEj3\nuIo9lDmzqmd7WCBPCkCXYcCAMLHgfvdP9iF5b1QRLhZeurM7ZUSMCoe9D3rC\nQXrh\r\n=ZarA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.radio.js","name":"@material/radio","types":"dist/mdc.radio.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Radio Buttons\"\nlayout: detail\nsection: components\niconId: radio_button\npath: /catalog/input-controls/radio-buttons/\n-->\n\n# Selection controls: radio buttons\n\n[Selection controls](https://material.io/components/selection-controls#usage) allow the user to select options.\n\nUse radio buttons to:\n\n* Select a single option from a list\n* Expose all available options\n* If available options can be collapsed, consider using a dropdown menu instead, as it uses less space.\n\n![Radio button hero example for menu options](images/radio-button-hero.png)\n\n**Contents**\n\n* [Using radio buttons](#using-radio-buttons)\n* [Radio buttons](#radio-buttons)\n* [Other variants](#other-variants)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using radio buttons\n\nRadio buttons allow the user to select one option from a set. Use radio buttons when the user needs to see all available options. If available options can be collapsed, consider using a dropdown menu because it uses less space.\n\n### Installing radio buttons\n\n```\nnpm install @material/radio\n```\n\n### Styles\n\n```scss\n@use \"@material/radio/styles\";\n@use \"@material/form-field\";\n\n@include form-field.core-styles;\n```\n\n**Note: The form field styles are only required when the radio button is used with the form field.**\n\n### JavaScript instantiation\n\nThe radio button will work without JavaScript, but you can enhance it with a ripple interaction effect by instantiating `MDCRadio` on the `mdc-radio` 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 `MDCRadio` instance as its `input`.\n\n```js\nimport {MDCFormField} from '@material/form-field';\nimport {MDCRadio} from '@material/radio';\n\nconst radio = new MDCRadio(document.querySelector('.mdc-radio'));\nconst formField = new MDCFormField(document.querySelector('.mdc-form-field'));\nformField.input = radio;\n```\n\n**Note: See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.**\n\n### Making radio buttons accessible\n\nMaterial Design spec advises that touch targets should be at least 48px x 48px.\nTo meet this requirement, add the `mdc-radio--touch` class to your radio as follows:\n\n```html\n<div class=\"mdc-touch-target-wrapper\">\n  <div class=\"mdc-radio mdc-radio--touch\">\n    <input class=\"mdc-radio__native-control\" type=\"radio\" id=\"radio-1\" name=\"radios\" checked>\n    <div class=\"mdc-radio__background\">\n      <div class=\"mdc-radio__outer-circle\"></div>\n      <div class=\"mdc-radio__inner-circle\"></div>\n    </div>\n    <div class=\"mdc-radio__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## Radio buttons\n\nWe recommend using MDC Radio 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### Radio button example\n\n```html\n<div class=\"mdc-form-field\">\n  <div class=\"mdc-radio\">\n    <input class=\"mdc-radio__native-control\" type=\"radio\" id=\"radio-1\" name=\"radios\" checked>\n    <div class=\"mdc-radio__background\">\n      <div class=\"mdc-radio__outer-circle\"></div>\n      <div class=\"mdc-radio__inner-circle\"></div>\n    </div>\n    <div class=\"mdc-radio__ripple\"></div>\n  </div>\n  <label for=\"radio-1\">Radio 1</label>\n</div>\n```\n\n### Radio button states\n\nRadio buttons can be selected or unselected. Radio buttons have enabled, disabled, hover, focused, and pressed states.\n\n![Radio button states in a table. Columns are enabled, disabled, hover, focused, pressed. Rows are selected or unselected](images/radio-button-states.png)\n\n## Other variants\n\n### Disabled radio buttons\n\nTo disable a radio button, add the `mdc-radio--disabled` class to the root element and set the `disabled` attribute on the `<input>` element.\nDisabled radio buttons cannot be interacted with and have no visual interaction effect.\n\n```html\n<div class=\"mdc-form-field\">\n  <div class=\"mdc-radio mdc-radio--disabled\">\n    <input class=\"mdc-radio__native-control\" type=\"radio\" id=\"radio-1\" name=\"radios\" disabled>\n    <div class=\"mdc-radio__background\">\n      <div class=\"mdc-radio__outer-circle\"></div>\n      <div class=\"mdc-radio__inner-circle\"></div>\n    </div>\n    <div class=\"mdc-radio__ripple\"></div>\n  </div>\n  <label for=\"radio-1\">Radio 1</label>\n</div>\n```\n\n## API\n\n### Sass mixins\n\nMDC Radio uses [MDC Theme](../mdc-theme)'s `secondary` color by default. Use the following mixins to customize it.\n\nMixin | Description\n--- | ---\n`unchecked-stroke-color($color)` | Sets the stroke color of an unchecked, enabled radio button\n`checked-stroke-color($color)` | Sets the stroke color of a checked, enabled radio button\n`ink-color($color)` | Sets the ink color of an enabled radio button\n`disabled-unchecked-stroke-color($color)` | Sets the stroke color of an unchecked, disabled radio button\n`disabled-checked-stroke-color($color)` | Sets the stroke color of a checked, disabled radio button\n`disabled-ink-color($color)` | Sets the ink color of a disabled radio button\n`focus-indicator-color($color)` | Sets the color of the focus indicator\n`touch-target($size, $ripple-size)` | Sets radio touch target size which can be more than the ripple size. Param `$ripple-size` is required for custom ripple size, defaults to `$ripple-size`.\n`ripple-size($size)` | Sets custom ripple size of radio.\n`density($density-scale)` | Sets density scale for radio. Supported density scale values are `-3`, `-2`, `-1` and `0` (default).\n\n## `MDCRadio` properties and methods\n\nProperty | Value Type | Description\n--- | --- | ---\n`checked` | Boolean | Setter/getter for the radio's checked state\n`disabled` | Boolean | Setter/getter for the radio's disabled state. Setter proxies to foundation's `setDisabled` method\n`value` | String | Setter/getter for the radio's value\n\n## Usage within web frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Radio button 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### `MDCRadioAdapter`\n\nMethod Signature | Description\n--- | ---\n`setNativeControlDisabled(disabled: boolean) => void` | Sets the input's `disabled` property to the given value\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\n### `MDCRadioFoundation`\n\nMethod Signature | Description\n--- | ---\n`setDisabled(disabled: boolean) => void` | Sets the disabled value of the native control\n","gitHead":"ab5924ae38bb3ce40d3b1c303e1ae6d175b844ce","license":"MIT","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"homepage":"https://github.com/material-components/material-components-web#readme","keywords":["material components","material design","radio"],"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-radio"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components for the web radio component","directories":{},"maintainers":[{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.70e1efdca.0","@material/base":"12.0.0-canary.70e1efdca.0","@material/theme":"12.0.0-canary.70e1efdca.0","@material/ripple":"12.0.0-canary.70e1efdca.0","@material/density":"12.0.0-canary.70e1efdca.0","@material/animation":"12.0.0-canary.70e1efdca.0","@material/touch-target":"12.0.0-canary.70e1efdca.0","@material/feature-targeting":"12.0.0-canary.70e1efdca.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/radio_12.0.0-canary.70e1efdca.0_1625159180454_0.8722536631624422","host":"s3://npm-registry-packages"},"_id":"@material/radio@12.0.0-canary.70e1efdca.0","version":"12.0.0-canary.70e1efdca.0"}