Venky free asked 5 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 answered 5 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 free commented 5 years ago

Thanks Jakub :)


Jakub Mandra staff commented 5 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

  • ForumUser: 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