menu
Dark Mode
backgroundLayer 1
preact-material-components
Components and their props
  • Slider
    • disabled true/false
      Tells if the slider is disabled.
    • min number
      Tells minimum value of the slider.
    • max number
      Tells maximum value of the slider.
    • step number
      Tells step/jump of the slider.
    • value number
      Tells current value of the slider.
    • discrete true/false
      Tells if the slider is discrete.
Custom events
  • onInput
    Fired when a user is dragging the slider or changing the value using the arrow keys.
  • onChange
    Fired when a user stops dragging the slider or changes the value using the arrow keys..
Sample code
import {h, Component} from 'preact';
import Slider from 'preact-material-components/Slider';
import 'preact-material-components/Slider/style.css';

export default class SnackbarPage extends Component {
  render(){
    return (
      <div>
        <Slider step={2} value={10} max={20}/>
      </div>
    );
  }
}
Original documentation
This component encapsulates mdc-slider, you can refer to its documentation here.
Demo
Regular
Disabled
Step 2, Max 20, Value 10
Discrete