New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@smui/checkbox

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smui/checkbox

Svelte Material UI - Checkbox

3.0.0-beta.5
Version published
Weekly downloads
7.8K
9.63%
Maintainers
1
Weekly downloads
 
Created

Svelte Material UI - Checkbox

Checkbox is used to provide the same functionality as <input type="checkbox">.

Installation

npm install --save-dev @smui/checkbox

Demo

in action: https://sveltematerialui.com/demo/checkbox

demo code: https://github.com/hperrin/svelte-material-ui/blob/master/site/src/routes/demo/checkbox/

Whoa There, These Docs are Outdated

The latest SMUI v3 beta had a lot of changes, and these docs haven't been caught up yet. You should check out the demo page's code to see the latest usage.

Basic Usage

<FormField>
  <Checkbox bind:checked={selected} />
  <span slot="label">Check me.</span>
</FormField>

<script>
  import Checkbox from '@smui/checkbox';
  import FormField from '@smui/form-field';

  let selected = false;
</script>

Exports

(default)

A checkbox.

Props / Defaults

  • use: [] - An array of Svelte actions and/or arrays of an action and its options.
  • class: '' - A CSS class string.
  • disabled: false - Whether the input is disabled.
  • touch: false - The checkbox will have a larger touch target.
  • indeterminate: (uninitialised) - Whether the state is indeterminate.
  • group: (uninitialised) - The selected values of a group of checkboxes as an array.
  • checked: (uninitialised) - A boolean, whether the checkbox is checked. This is used instead of group for a single checkbox.
  • value : null - The value of a checkbox in a group of checkboxes.
  • valueKey : (uninitialised) - If value is not a string, this should be supplied as well, and should be a unique key.

Forwarded Props

  • input$ - Props forwarded to the input element.

Events

All standard UI events are forwarded.

  • change
  • input

Functions

  • getId - Get the HTML ID of the element.

More Information

See Checkboxes in the Material design spec.

See Checkbox in MDC-Web for information about the upstream library's architecture.

FAQs

Package last updated on 14 Apr 2021

Did you know?

Socket

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.

Install

Related posts