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

@rmwc/switch

Package Overview
Dependencies
Maintainers
1
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rmwc/switch

RMWC Switch component

  • 1.10.0-alpha.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.8K
increased by15.81%
Maintainers
1
Weekly downloads
 
Created
Source

Switches

On/off switches toggle the state of a single settings option. The option that the switch controls, as well as the state it’s in, should be made clear from the corresponding inline label. Switches take on the same visual properties of the radio button.

  • import from rmwc/Switch
  • import styles from @material/switch/dist/mdc.switch.css
  • https://material.io/develop/web/components/input-controls/switches/

Switches are identical in function to the Checkbox component, they just present a different UI / UX paradigm.

import { Switch } from 'rmwc/Switch';

{/* Controlled with change handler */}
<Switch
  checked={!!this.state.cookiesChecked}
  onChange={evt => this.setState({cookiesChecked: evt.target.checked})}>
  Cookies
</Switch>

{/* Uncontrolled Switch */}
<Switch defaultChecked>Pizza</Switch>

{/* Using the label prop */}
<Switch label="Icecream" />

{/* Disabled */}
<Switch disabled label="Disabled" />
import { DocumentComponent } from 'rmwc/Base/utils/DocumentComponent';

<DocumentComponent displayName="Switch" />

Keywords

FAQs

Package last updated on 06 Sep 2018

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

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