Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

beautiful-react-hooks

> 前端框架
Open source

A collection of beautiful and (hopefully) useful React hooks to speed-up your components and hooks development

8.3K stars0 likes4 views
WebsiteGitHub

About

A collection of beautiful and (hopefully) useful React hooks to speed-up your components and hooks development


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

  • Concise API
  • Small and lightweight
  • Easy to learn

Install

by using npm:

bash
$ npm install beautiful-react-hooks

by using yarn:

bash
$ yarn add beautiful-react-hooks

Basic usage

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

typescript
import useSomeHook from 'beautiful-react-hooks/useSomeHook'

Hooks

  • useMutableState
  • useInfiniteScroll
  • useObservable
  • useEvent
  • useGlobalEvent
  • usePreviousValue
  • useValueHistory
  • useValidatedState
  • useMediaQuery
  • useOnlineState
  • useViewportSpy
  • useViewportState
  • useSpeechRecognition and useSpeechSynthesis
  • useGeolocation, useGeolocationState and useGeolocationEvents
  • useDrag, useDropZone and useDragEvents
  • useMouse, useMouseState and useMouseEvents
  • useTouch, useTouchState and useTouchEvents
  • useLifecycle, useDidMount and useWillUnmount
  • useWindowResize
  • useWindowScroll
  • useRequestAnimationFrame
  • useResizeObserver
  • useTimeout
  • useInterval
  • useDebouncedCallback
  • useThrottledCallback
  • useLocalStorage
  • useSessionStorage
  • useDefaultedState
  • useRenderInfo
  • useSwipe, useHorizontalSwipe and useVerticalSwipe
  • useSwipeEvents
  • useConditionalTimeout
  • useCookie
  • useDarkMode
  • useUnmount
  • useUpdateEffect
  • useIsFirstRender
  • useMutationObserver
  • useAudio
  • useObjectState
  • useToggle
  • useQueryParam
  • useQueryParams
  • useSearchQuery
  • useURLSearchParams

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

Issues· 11 open

View all issuesOpen on GitHub
  • #436

    useTableParams hook

    Updated Sep 6, 2026
  • #435

    [Typescript] hooks do not support null or undefined type in ref attributes

    Updated Jul 6, 2026
  • #433

    React Router Vulnerability

    Updated Oct 14, 2025
  • #412

    `useGeolocation` not updating state in Firefox desktop

    Updated Aug 9, 2024
  • #420

    useDebouncedCallback doesn't consider its dependencies

    bughelp wantedgood first issueUpdated Jul 17, 2024
  • #422

    react-router peer dependency is being install

    Updated Mar 29, 2024
  • #136

    100% code coverage

    enhancementhelp wantedgood first issueUpdated Nov 13, 2023
  • #413

    useAudioControls returning new controls object everytime state is updated

    Updated May 25, 2023
  • #406

    Deprecate all react-router-dom related hooks

    Updated Mar 15, 2023
  • #376

    Autogenerate CHANGELOG.md

    bugdocumentationenhancementUpdated Jun 28, 2022

> Tags

JavaScriptcustom-hooksfront-endhooksreact

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架