On/off toggle with role="switch"; onChange receives the new boolean. Add showState to print | or 0 inside the track.

Props

  • checkedboolean

    On/off state.

  • onChange(checked: boolean) => void

    Called with the new state.

  • labelReactNode

    Label text.

  • showStateboolean
    Default: false

    Print | (on) or 0 (off) inside the track.

  • disabledboolean
    Default: false

    Disable the control.

  • classNamestring
    Default: ''

    Extra classes for the root element.

  • ...rest

    Any other props are passed to the underlying element.