mantine-hooks
Skill1 starsChanged 3 months agoMITView on GitHub
Build, review, debug, migrate, or plan React code with @mantine/hooks only (standalone React hooks package). Use for useDisclosure, useToggle, useListState, useLocalStorage, useSessionStorage, useHotkeys, getHotkeyHandler, useClickOutside, useDebouncedValue, useDebouncedState, useDebouncedCallback, useThrottledValue, useMediaQuery, useColorScheme, useReducedMotion, useMergedRef, useMove, useDrag, useMask, useCollapse, useHorizontalCollapse, useRovingIndex, useSplitter, useFloatingWindow, useUncontrolled, useFocusTrap, useIntersection, useResizeObserver, useFetch, clamp, randomId, and Mantine 8→9 hooks migrations. Do not use for @mantine/core components, @mantine/form, themes, or other Mantine packages.
In this repository81 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agents-mdSkill
- base-uiSkill
- better-authSkill
- brainstormSkill
- bullmqSkill
- bunSkill
- clickhouseSkill
- clone-to-tempSkill
- compound-uiSkill
- copywritingSkill
- create-durable-planSkill
- d3Skill
- date-fnsSkill
- decimal-jsSkill
- deduplicateSkill
- design-engineerSkill
- designSkill
- drizzle-ormSkill
- effectSkill
- elysia-architectureSkill
- elysiaSkill
- evlogSkill
- feedsmithSkill
- grokSkill
- handoffSkill
- heyapiSkill
- impitSkill
- intlayerSkill
- jsdocSkill
- kafkaSkill
- kill-legacySkill
- legend-stateSkill
- loopSkill
- mobbinSkill
- motionSkill
- oxfmtSkill
- oxlintSkill
- permixSkill
- plain-languageSkill
- playwrightSkill
- react-boundariesSkill
- react-emailSkill
- reactSkill
- reorganizeSkill
- researchSkill
- schema-dtsSkill
- sentrySkill
- seoSkill
- setup-competitors-mdSkill
- setup-copywriting-mdSkill
- setup-icp-mdSkill
- setup-project-mdSkill
- simplify-layoutSkill
- storybookSkill
- subagentsSkill
- tailwindSkill
- tailwind-variantsSkill
- takumiSkill
- tanstack-chartsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill for @mantine/hooks only — the standalone React hooks package.
- Very specific: line 10
Prefer current docs over memory.
- Very specific: line 28
Import only from
@mantine/hooks: Prefer named imports: import { useDisclosure, clamp } from '@mantine/hooks'. - Very specific: line 31
Prefer exported option/return types (UseDisclosureOptions, or namespace forms like useDisclosure.Options) over reinventing shapes.
- Very specific: line 39
Fullscreen: use useFullscreenDocument or useFullscreenElement — there is no single useFullscreen export in 9.x.
- Distinctive: line 43
Keep examples and generated code free of other Mantine packages unless the surrounding project already depends on them and the user asked …
- Very specific: line 57
Prefer the repo's existing checks.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Mantine Hooks
Use this skill for @mantine/hooks only — the standalone React hooks package. Do not pull in @mantine/core, @mantine/form, or other @mantine/* packages unless the user explicitly asks for them outside this skill.
Prefer current docs over memory. Pin narrative to @mantine/hooks@9.x (npm latest snapshot: 9.5.0, peer react@^19.2.0).
Workflow
- Inspect the project before changing code:
- Installed
@mantine/hooksversion and React peer version. - Whether the app is SPA-only or SSR/hydrated (affects
getInitialValueInEffectand media/storage hooks). - Which hook families are in play: state, storage, events, observers, timing, or interaction builders.
- Installed
- Refresh versions and doc URLs from source-map.md when behavior or migration matters.
- For install, imports, utils, SSR defaults, types, and package boundaries, use setup-core.md.
- For boolean/list/object/Map/Set state, uncontrolled values, storage, queue, pagination, and history, use state-storage.md.
- For click-outside, hotkeys, focus, hover/mouse, clipboard, fullscreen, long-press, and window/document events, use ui-events.md.
- For media queries, observers, debounce/throttle, timers, idle/network/OS, and fetch, use observers-timing.md.
- For move/drag/radial, collapse, mask, roving index, splitter, floating window, selection, and scroll helpers, use advanced-interaction.md.
- For a full hook index with doc links, use catalog.md.
Implementation Judgment
- Import only from
@mantine/hooks. Prefer named imports:import { useDisclosure, clamp } from '@mantine/hooks'. - Package is standalone: React peer only. Safe in any React web app without other Mantine packages. State-management hooks (e.g.
usePagination,useQueue) also work in React Native; DOM/window hooks do not. - React 19.2+ is required for 9.x. Several hooks use React 19
useEffectEvent(usePageLeave,useWindowEvent,useHotkeys,useClickOutside,useCollapse) — do not forceuseCallbackwrappers just to keep listeners stable. - Prefer exported option/return types (
UseDisclosureOptions, or namespace forms likeuseDisclosure.Options) over reinventing shapes. - SSR-sensitive hooks (
useMediaQuery,useColorScheme,useReducedMotion,useLocalStorage/useSessionStorage, viewport size): default path calculates after mount viagetInitialValueInEffect: true. Pass an explicitinitialValue/defaultValuefor the server render; setgetInitialValueInEffect: falseonly for CSR-only apps that need the real value on first paint. - Combine ref-returning hooks with
useMergedRef/mergeRefs(e.g.useClickOutside+useFocusTrap+ local ref). - Debounce triad:
useDebouncedValue— controlled source value stays immediate; debounced copy for effects/search.useDebouncedState— setter itself is debounced (uncontrolled-style).useDebouncedCallback— debounce a function (flush/cancel/isPending).
- Same split for throttle:
useThrottledValue/useThrottledState/useThrottledCallback. - Fullscreen: use
useFullscreenDocumentoruseFullscreenElement— there is no singleuseFullscreenexport in 9.x. - Mouse:
useMouseis element-ref based;useMousePositiontracks document-level position. - Callback-ref hooks (
useResizeObserver,useMouse,useMutationObserver, many interaction hooks) tolerate dynamic node swaps — prefer the returned ref callback over staleuseRefassignment patterns. useFetchis a thin fetch helper, not a server-state library — fine for small one-off loads; do not treat it as Query/SWR.- Keep examples and generated code free of other Mantine packages unless the surrounding project already depends on them and the user asked for that surface.
Migration traps (8 → 9)
- Peer React 19.2+.
useFullscreen→useFullscreenDocument/useFullscreenElement.useMousesplit →useMouse+useMousePosition.useResizeObserver/useMutationObserver→ callback-ref APIs;useMutationObserverTargetfor external nodes.useDisclosuregainshandlers.set(boolean).- Renamed types:
UseScrollSpyReturnType→UseScrollSpyReturnValue,StateHistory→UseStateHistoryValue,OS→UseOSReturnValue. useMediaQuerydropped very-old SafarimatchMediafallbacks.
Verification
Prefer the repo's existing checks. For meaningful @mantine/hooks work, include the relevant subset:
- Typecheck against installed
@mantine/hooksdeclarations and exported option/return types. - Confirm imports resolve only from
@mantine/hooks(no accidental@mantine/corefor hook-only tasks). - SSR/hydration: assert server HTML uses intended initial values for media/storage hooks; no flash regressions when changing
getInitialValueInEffect. - Interaction tests: outside-click nodes (use state callbacks for multi-node lists), hotkey
modcross-platform, focus trap + merged refs, debouncecancel/flushon unmount. - Migration scan for removed
useFullscreen, old mouse/observer ref patterns, and renamed types.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

