A collection of zero-dependency hooks for SolidJS forked directly from Mantine Hooks.
Install it:
npm i bagon-hooks
# or
yarn add bagon-hooks
# or
pnpm add bagon-hooks
# or
bun add bagon-hooks
Use it:
import { useHotkeys } from 'bagon-hooks';
We want to achieve as 1:1 as possible with Mantine's original hooks. So you can always refer to their original docs.
- 🌳 Tree-shakable
- 🖌️ TypeScript support
- 🔵 For SolidJS
- 📦 Zero-dependencies (except Solid)
Based on the @mantine/hooks library.
- use-callback-ref
- use-click-outside
- use-clipboard
- use-color-scheme
- use-counter
- use-debounced-callback
- use-debounced-state
- use-debounced-value
- use-did-update
- use-disclosure
- use-document-title
- use-document-visibility
- use-event-listener
- use-eye-dropper (improved, state management is inside the hook)
- use-favicon (improved, more flexible)
- use-fetch
- use-focus-return
- use-focus-trap
- use-focus-within
- use-force-update
- use-fullscreen
- use-hash
- use-headroom
- use-hotkeys
- use-hover
-
use-id(Solid hascreateUniqueId
) - use-idle (Added, but note that there is
createIdleTimer
solid-primitives as well) - use-in-viewport
- use-input-state
- use-intersection
- use-interval
- use-is-first-render
-
use-isomorphic-effect(Solid'screateEffect
is actually isomorphic - it works in browser and server). - use-list-state
- use-local-storage
- use-logger
- use-map
- use-media-query
- use-merged-ref
- use-mounted
- use-mouse
- use-move
- use-mutation-observer
- use-network
- use-orientation
- use-os
- use-page-leave
- use-pagination
- use-previous
- use-queue
- use-reduced-motion
- use-resize-observer
- use-scroll-into-view
- use-session-storage
- use-set-state
- use-set
- use-shallow-effect
- use-state-history
- use-text-selection
- use-throttled-callback
- use-throttled-state
- use-throttled-value
- use-timeout
- use-toggle
- use-uncontrolled
- use-validated-state
- use-viewport-size
- use-window-event
- use-window-scroll
- utils
- Docs Website (Powered by mdx + tailwind prose)
- Examples
- Tests?
This library is far from done. If you have time implementing the roadmap, feel free to submit a pull request. We always appreciate collaborators. If you find anything outdated, please make an issue. If you like this project, consider giving it a star! ⭐️
This project is licensed under the MIT License
- Mantine Hooks - amazing library for components and hooks, but currently not in SolidJS so we forked that part only.