Switch

Venky asked 6 years ago

Hi there,

I'm using MDBR v4.9.0, MDBSwitch is working fine. But can we've some more functionalities like

  1. Adding custom labels instead of default On and Off
  2. Only the switch (No names On and Off)

It would be great if we've these functionalities in the next release

Thanks :)


Jakub Mandra staff premium answered 6 years ago

Hi,

Switch is armed with properties: labelLeft and labelRight which let you smoothly change those labels. We are sorry for the lacks in the documentation -> we have made up it right now after your reports.

Example usage:

<MDBSwitch
  checked={this.state.switchState}
  getValue={this.handleSwitchChange}
  labelLeft="No"
  labelRight="Yes"
/>

And without labels:

<MDBSwitch
  checked={this.state.switchState}
  getValue={this.handleSwitchChange}
  labelLeft=""
  labelRight=""
/>

Wish you best,

Jakub


Venky commented 6 years ago

Thanks Jakub :)


Jakub Mandra staff premium commented 6 years ago

Glad I could help ;-)


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.8.4
  • Device: Laptop
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No
Tags