Topic: Side nav bar
I want to hide and show sidebar on click of a custom button created using MDBBtn .How to achieve that?
Konrad Stępień staff answered 5 years ago
Hi @Palak@tru,
If you use basic example from here
just set this function
handleToggle = () => {
this.setState({
isOpen: !this.state.isOpen
});
};
for your custom button with onClick
method.
For example:
<MDBBtn color="elegant" onClick={this.handleToggle}>Toggler</MDBBtn>
Kind regards, Konrad.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB React
- MDB Version: 4.19.0
- Device: MacBookAir
- Browser: Chrome
- OS: Mac
- Provided sample code: No
- Provided link: No