https://github.com/calvein/use-toggle
React hook for toggling things
https://github.com/calvein/use-toggle
hooks react
Last synced: 3 months ago
JSON representation
React hook for toggling things
- Host: GitHub
- URL: https://github.com/calvein/use-toggle
- Owner: Calvein
- License: mit
- Created: 2018-10-25T21:34:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T11:17:33.000Z (over 2 years ago)
- Last Synced: 2025-03-13T04:04:58.008Z (4 months ago)
- Topics: hooks, react
- Language: JavaScript
- Size: 642 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `@calvein/use-toggle`
> React hook for toggling
## Install
```sh
npm install @calvein/use-toggle
```## Usage
```js
import useToggle from '@calvein/use-toggle';const MyComponent = () => {
const { isOn, isOff, on, off, toggle } = useToggle();return (
is {isOn ? 'on' : 'off'}
);
}
```