Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/calvein/use-toggle
React hook for toggling things
https://github.com/calvein/use-toggle
hooks react
Last synced: about 2 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 (almost 2 years ago)
- Last Synced: 2024-12-12T10:33:28.679Z (about 2 months ago)
- Topics: hooks, react
- Language: JavaScript
- Size: 642 KB
- Stars: 2
- Watchers: 1
- 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'}
);
}
```