menu
Dark Mode
backgroundLayer 1
preact-material-components
Components and their props
  • Switch
    • disabled true/false
      Disables the switch.
Sample code
import {h, Component} from 'preact';
import Switch from 'preact-material-components/Switch';
import 'preact-material-components/Switch/style.css';

export default class SwitchPage extends Component {
  render(){
    return (
      <div>
        <Switch/>
      </div>
    );
  }
}
Original documentation
This component encapsulates mdc-switch, you can refer to its documentation here.
Demo
Default
<Switch />
Disabled
<Switch disabled={true} />