A collection of zero-dependency hooks for SolidJS forked directly from Mantine Hooks, with some improvements.
A hook that returns a signal with a counter value and functions to increment, decrement, set and reset the counter.
Returns the current OS
Detects clicks outside a ref
Handle hotkeys easily
Detects hovers on a ref
Returns if user has been idle after some milliseconds
Returns true if component is mounted. Useful for rendering only on client-side.
Returns information about current user's network connection. Try going offline on DevTools.
{ "online": true }
Returns information about a resizable element. This is more low-level but gives you more than just width and height.
{ "rect": { "x": 0, "y": 0, "width": 0, "height": 0, "top": 0, "left": 0, "bottom": 0, "right": 0 } }
Returns width and height of a resizable element. An abstraction over useResizeObserver.
A hook that toggles between two or multiple values (by implementing a common state pattern). Dev Note: Personally this can be called `useCycle` instead since it cycles through the options.
Appends <link /> element to head component with given favicon url. The hook is not called during server side rendering.
A hook that allows using value from the localStorage as a signal. The hook works exactly the same way as createSignal, but also writes the value to the localStorage. It even works between tabs!
To test, try changing the value with two tabs open.
A hook that gives you the ability to open the browser's EyeDropper API and save it to a signal.