MCPcopy Index your code
hub / github.com/antonioru/beautiful-react-hooks

github.com/antonioru/beautiful-react-hooks @v5.0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v5.0.3 ↗ · + Follow
204 symbols 673 edges 162 files 1 documented · 0% updated 5mo agov5.0.3 · 2025-03-12★ 8,3538 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

CI/CD Coverage StatusLicense:
MIT npm GitHub stars

<img src="https://github.com/antonioru/beautiful-react-hooks/raw/v5.0.3/logo.png" alt="Beautiful React Hooks" width="750px" />















A collection of tailor-made React hooks to enhance your development process and make it faster.













<a href="https://antonioru.github.io/beautiful-react-hooks/" target="_blank">
🌟 Hooks Playground 🌟
</a>

Usage example

🇬🇧 English | 🇨🇳 简体中文 | 🇮🇹 Italiano | 🇪🇸 Español | 🇺🇦 Ukrainian | 🇧🇷 Brazilian Portuguese | 🇵🇱 Polski | 🇯🇵 日本語 | 🇹🇷 Türkçe

💡 Why?

Custom React hooks allow developers to abstract the business logic of components into single, reusable functions.\ I have noticed that many of the hooks I have created and shared across projects involve callbacks, references, events, and dealing with the component lifecycle.\ Therefore, I have created beautiful-react-hooks, a collection of useful React hooks that may help other developers speed up their development process.\ Moreover, I have strived to create a concise and practical API that emphasizes code readability, while keeping the learning curve as low as possible, making it suitable for larger teams to use and share t -- Please before using any hook, read its documentation! --

☕️ Features

🕺 Install

by using npm:

$ npm install beautiful-react-hooks

by using yarn:

$ yarn add beautiful-react-hooks

Basic usage

importing a hooks is as easy as the following straightforward line:

ts static import useSomeHook from 'beautiful-react-hooks/useSomeHook'

🎨 Hooks

Peer dependencies

Some hooks are built using third-party libraries (such as rxjs, react-router-dom, redux). As a result, you will see these libraries listed as peer dependencies.\ Unless you are using these hooks directly, you need not install these dependencies.

Contributing

Contributions are very welcome and wanted.

To submit your custom hook, make sure you have thoroughly read and understood the CONTRIBUTING guidelines.

Prior to submitting your pull request: please take note of the following

  1. make sure to write tests for your code, run npm test and npm build before submitting your merge request.
  2. in case you're creating a custom hook, make sure you've added the documentation (you may use the HOOK_DOCUMENTATION_TEMPLATE to document your custom hook).

Credits

Icon made by Freepik from www.flaticon.com

Extension points exported contracts — how you extend this code

UseSwipeEventsReturn (Interface)
* The result of the hook
src/useSwipeEvents.ts
UseIntervalOptions (Interface)
(no doc)
src/useInterval.ts
SpeechRecognitionEvent (Interface)
(no doc)
src/useSpeechRecognition.ts
UseDropZoneResult (Interface)
(no doc)
src/useDropZone.ts
UseDragOptions (Interface)
(no doc)
src/useDrag.ts
UseQueryParamsOptions (Interface)
(no doc)
src/useQueryParams.ts
UseConditionalTimeoutOptios (Interface)
(no doc)
src/useConditionalTimeout.ts
UseGeolocationEventsResult (Interface)
(no doc)
src/useGeolocationEvents.ts

Core symbols most depended-on inside this repo

assertHook
called by 58
test/utils/assertHook.js
useEvent
called by 25
src/useEvent.ts
createHandlerSetter
called by 24
src/factory/createHandlerSetter.ts
warnOnce
called by 14
src/shared/warnOnce.ts
isFunction
called by 11
src/shared/isFunction.ts
promiseDelay
called by 9
test/utils/promiseDelay.js
useMouseEvents
called by 9
src/useMouseEvents.ts
assertFunction
called by 8
test/utils/assertFunction.js

Shape

Function 144
Interface 43
Class 8
Method 8
Enum 1

Languages

TypeScript100%

Modules by API surface

src/useCookie.ts10 symbols
src/useSwipeEvents.ts8 symbols
src/useSwipe.ts7 symbols
src/useAudio.ts7 symbols
src/useSpeechRecognition.ts6 symbols
test/mocks/ResizeObserver.mock.js5 symbols
test/mocks/IntersectionObserver.mock.js5 symbols
test/mocks/CookieStoreApi.mock.js4 symbols
src/useGeolocationState.ts4 symbols
src/useGeolocationEvents.ts4 symbols
src/shared/swipeUtils.ts4 symbols
test/mocks/SpeechSynthesisUtterance.mock.js3 symbols

Dependencies from manifests, versioned

@ant-design/icons5.0.1 · 1×
@babel/core7.21.0 · 1×
@babel/preset-env7.20.2 · 1×
@babel/preset-react7.18.6 · 1×
@babel/register7.21.0 · 1×
@semantic-release/changelog6.0.2 · 1×
@semantic-release/commit-analyzer9.0.2 · 1×
@semantic-release/exec6.0.3 · 1×
@semantic-release/git10.0.1 · 1×
@semantic-release/npm9.0.2 · 1×
@testing-library/react14.0.0 · 1×

For agents

$ claude mcp add beautiful-react-hooks \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact