
The mdc-checkbox_focus-ring element ensures that a focus indicator is displayed in high contrast mode around the active/focused checkbox. Note 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). To meet this requirement, add the mdc-checkbox-touch class to your checkbox as follows: Material Design spec advises that touch targets should be at least 48px x 48px. > See Importing the JS component for more information on how to import JavaScript. import from checkbox = new MDCCheckbox( document.querySelector( '.mdc-checkbox')) Ĭonst formField = new MDCFormField( document.querySelector( '.mdc-form-field')) 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. The checkbox will work without JavaScript, but you can enhance it with a ripple interaction effect by instantiating MDCCheckbox on the mdc-checkbox element. Note: The form field styles are only required when the checkbox is used with the form field. Installing checkboxes npm install re-styles Checkboxes can be used to turn an option on or off. Turn an item on or off in a desktop environmentĬheckboxes allow the user to select one or more items from a set.


Present a list containing sub-selections.Selection controls allow the user to select options.
