react-toggler
v1.0.1
Published
A utility React component, switch the show/hide of component.
Downloads
6
Readme
react-toggler
A utility React component, switch the show/hide of component.
npm i react-toggler
Usage
import Toggler from 'react-toggler';
<Toggler>Content</Toggler>
<Toggler hide={() => doSomething()}>Content</Toggler>
<Toggler pattern={[true, false]}>
<div>A</div> // Show
<div>B</div> // Hide
</Toggler>
<Toggler pattern={{ 0: false 1: true }}>
<div>A</div> // Hide
<div>B</div> // Show
</Toggler>
Contributing
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request :D
License
© sugarshin