h3/use's logo

h3/use

Command Palette

Search for a command to run...

Hooks Library for Software Engineers

Free and open-source hooks build with React and TypeScript. Perfect for your next application. Shadcn powered.

Currently with 36 hooks.

Hooks Demo

Here are some of the hooks that you can use to build your apps.

useWindowSize
This component uses the useWindowSize hook to get the current window size.

Width: 1024

Height: 768

Resize the window to see the values changing.

useKeypress
This component uses the useKeypress hook to detect key combinations.

Press Ctrl+M (Windows/Linux) or Cmd+M (Mac)

Shortcut pressed 0 times.

Press Ctrl+K to reset the count.

useFullscreen
This component uses the useFullscreen hook to toggle fullscreen mode for a specific element.

Not Fullscreen

useToggle
This component uses the useToggle hook to toggle a boolean state.

The state is: Off

useDebounceState
This component uses the useDebounceState hook to debounce the state update.
Immediate value:
Debounced value:
The debounced value updates 1s after you stop typing.
useLocalStorage
This component uses the useLocalStorage hook to manage a local storage item.

Name:

Looks in the local storage for the key demo-name.

useCopyToClipboard
This component uses the useCopyToClipboard hook to copy text to the clipboard.
useIdle
This component uses the useIdle hook to detect if the user is idle for a given timeout (2 seconds).
The user is

idle

Interact with the page (keyboard, mouse, scroll, etc) to reset the idle timer.

useOnMount
This example uses the useOnMount hook to execute a function only once when the component is mounted.

Waiting for mount...

Check console for more information.

useDidUpdate
This example uses the useDidUpdate hook to execute a function when the count state is updated.

0