An open API service indexing awesome lists of open source software.

https://github.com/azlibdar/hoocs

A CLI-driven React hooks library
https://github.com/azlibdar/hoocs

cli hoocs hooks reacthooks

Last synced: 4 months ago
JSON representation

A CLI-driven React hooks library

Awesome Lists containing this project

README

        

# Hoocs - A CLI-driven React hooks library

A CLI-driven React hooks library offering a collection of ready-to-use Typescript hooks that you can easily copy, customize, and integrate into your projects.

![npm version](https://img.shields.io/npm/v/hoocs.svg)
![license](https://img.shields.io/npm/l/hoocs)
![downloads](https://img.shields.io/npm/dm/hoocs)
![typeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue)


## Installation

#### Install the CLI Globally:

```powershell
npm install -g hoocs
```

#### Add Configuration File:

This will create `hoocs.json` in the root of your project and help you set destination paths for hooks.

```powershell
npx hoocs init
```

#### Add Hooks to Your Project:

```powershell
npx hoocs add useTheme
```

#### List Available Hooks:

```powershell
npx hoocs list
```


> Need hooks for JavaScript projects? Until we officially support them, there is a simple workaround. After installing, you can change the file extension to `.js` and remove the types from the hook file.


## Hooks and Documentation

Visit: [Hoocs Documentation](https://hoocs-web.vercel.app/) for detailed information on each hook.

### Available Hooks

- [useCopyToClipboard](https://hoocs-web.vercel.app/useCopyToClipboard)
- [useCounter](https://hoocs-web.vercel.app/useCounter)
- [useDebounce](https://hoocs-web.vercel.app/useDebounce)
- [useDefault](https://hoocs-web.vercel.app/useDefault)
- [useDeviceSize](https://hoocs-web.vercel.app/useDeviceSize)
- [useDocumentTitle](https://hoocs-web.vercel.app/useDocumentTitle)
- [useInViewport](https://hoocs-web.vercel.app/useInViewport)
- [useLockScroll](https://hoocs-web.vercel.app/useLockScroll)
- [useOnline](https://hoocs-web.vercel.app/useOnline)
- [usePageVisibility](https://hoocs-web.vercel.app/usePageVisibility)
- [usePrevious](https://hoocs-web.vercel.app/usePrevious)
- [useReducedMotion](https://hoocs-web.vercel.app/useReducedMotion)
- [useTabAway](https://hoocs-web.vercel.app/useTabAway)
- [useTheme](https://hoocs-web.vercel.app/useTheme)
- [useWindowSize](https://hoocs-web.vercel.app/useWindowSize)


Don't see a hook you need? [Request a new hook](https://github.com/azlibdar/hoocs/issues) or [contribute](CONTRIBUTING.md) to the project.


## Contributing

We welcome contributions to Hoocs! Please check out the [contribution guide](CONTRIBUTING.md) to get started.