7.14.1 • Published 2 years ago

rooks v7.14.1

Weekly downloads
1,540
License
MIT
Repository
github
Last release
2 years ago

CI and Semantic Release GitHub GitHub release (latest by date) GitHub contributors npm npm bundle size Codecov branch node-lts Website Module

List of all hooks

🔥 Effects

🚀 Events

📝 Form

✨ Misc

🚃 Navigator

❇️ State

  • useArrayState - Array state manager hook for React
  • useCountdown - Count down to a target timestamp and call callbacks every second (or provided peried)
  • useCounter - Counter hook for React.
  • useGetIsMounted - Checks if a component is mounted or not at the time. Useful for async effects
  • useLocalstorageState - UseState but auto updates values to localStorage
  • useMapState - A react hook to manage state in a key value pair map.
  • useMultiSelectableList - A custom hook to easily select multiple values from a list
  • useNativeMapState - Manage Map() object state in React
  • usePreviousDifferent - usePreviousDifferent returns the last different value of a variable
  • usePreviousImmediate - usePreviousImmediate returns the previous value of a variable even if it was the same or different
  • usePromise - Promise management hook for react
  • useQueueState - A React hook that manages state in the form of a queue
  • useSafeSetState - set state but ignores if component has already unmounted
  • useSelect - Select values from a list easily. List selection hook for react.
  • useSelectableList - Easily select a single value from a list of values. very useful for radio buttons, select inputs etc.
  • useSessionstorageState - useState but syncs with sessionstorage
  • useSetState - Manage the state of a Set in React.
  • useStackState - A React hook that manages state in the form of a stack
  • useTimeTravelState - A hook that manages state which can undo and redo. A more powerful version of useUndoState hook.
  • useUndoRedoState - Setstate but can also undo and redo
  • useUndoState - Drop in replacement for useState hook but with undo functionality.

⚛️ UI

  • useAudio - Audio hook
  • useBoundingclientrect - getBoundingClientRect hook for React.
  • useBoundingclientrectRef - A hook that tracks the boundingclientrect of an element. It returns a callbackRef so that the element node if changed is easily tracked.
  • useFullscreen - Use full screen api for making beautiful and emersive experinces.
  • useGeolocation - A hook to provide the geolocation info on client side.
  • useInViewRef - Simple hook that monitors element enters or leave the viewport that's using Intersection Observer API.
  • useIntersectionObserverRef - A hook to register an intersection observer listener.
  • useKey - keypress, keyup and keydown event handlers as hooks for react.
  • useKeyBindings - useKeyBindings can bind multiple keys to multiple callbacks and fire the callbacks on key press.
  • useKeyRef - Very similar useKey but it returns a ref
  • useKeys - A hook which allows to setup callbacks when a combination of keys are pressed at the same time.
  • useMediaMatch - Signal whether or not a media query is currently matched.
  • useMouse - Mouse position hook for React.
  • useMutationObserver - Mutation Observer hook for React.
  • useMutationObserverRef - A hook that tracks mutations of an element. It returns a callbackRef.
  • useRaf - A continuously running requestAnimationFrame hook for React
  • useResizeObserverRef - Resize Observer hook for React.
  • useVideo - Video hook for react
  • useWindowScrollPosition - A React hook to get the scroll position of the window
  • useWindowSize - Window size hook for React.

Features

✅ Collection of 91 hooks as standalone modules.

✅ Standalone package with all the hooks at one place

✅ CommonJS, UMD and ESM Support

Installation

npm i -s rooks

Import any hook from "rooks" and start using them!

import { useDidMount } from "rooks";

Usage

function App() {
  useDidMount(() => {
    alert("mounted");
  });
  return (
    <div className="App">
      <h1>Hello CodeSandbox</h1>
      <h2>Start editing to see some magic happen!</h2>
    </div>
  );
}

Standalone Package

Package containing all the hooks is over here. - Docs and Npm Install

License

MIT

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):

@useherald/react-widget@remix-kawaii/language@everything-registry/sub-chunk-2683withub-ui-components@clutch-marketplace/react-hooks@deeptrekker/react@deeptrekker/react-sdk@deeptrekker/file-system@alphakits/ui@bevops/search@codesmit/jomo-components@davidscicluna/component-library@digit-ui/digit-ui-module-common@digit-ui/digit-ui-module-hrms-mfeuse-clamp-text@grooviz/fit-text@hashintel/type-editor@flyde/flow-editor@iameli/livepeer-player@healthnz/pattern-library@hunterfielow/use-clamp-text@egovernments/digit-ui-module-hrms@egovernments/digit-ui-module-common@egovernments/digit-ui-module-receipts@element-public/react-input-chip@govconnex/ui@laerdal/life-react-components@make-live/toolkit-dev@invisible/components@jfrancos/suoli@hyperobjekt/mapgl@indicsoft/digit-ui-module-hrms@indicsoft/digit-ui-module-receipts@indicsoft/digit-ui-module-reports@indicsoft/digit-ui-module-common@react-mool/core@sarim.garden/cardboard@opengovsg/design-system-react@nudm/digit-ui-module-common@nudm/digit-ui-module-hrms@nudm/digit-ui-module-receipts@nudm/digit-ui-module-reports@nudmcdgnpm/digit-ui-module-common@nudmcdgnpm/digit-ui-module-hrms@nudmcdgnpm/digit-ui-module-receipts@nudmcdgnpm/digit-ui-module-reports@resonance-box/react-recital@seeqdev/qomponents@selco/digit-ui-module-hrmsmodern-web-swiss-army-knifepoltapp01review-hubshookt@uncx/ui-library@threenever/chakra-ui-carousel@touk/window-manager@upyog/digit-ui-module-common@upyog/digit-ui-module-hrms@upyog/digit-ui-module-receipts@upyog/digit-ui-module-reports@unstoppabledomains/ui-componentschakra-ui-carouselcontactuseditorcozy-searchcozy-uicustomdash001bearer-auth-react-contextexemplis-customizer@sheetxl/sheet-react@tamagui-extras/ui@te-whatu-ora/anatomic
7.4.4

2 years ago

7.5.0

2 years ago

7.6.1

2 years ago

7.6.0

2 years ago

7.11.3

2 years ago

7.11.1

2 years ago

7.11.2

2 years ago

7.11.0

2 years ago

7.7.0

2 years ago

7.10.0

2 years ago

7.10.1

2 years ago

7.8.0

2 years ago

7.8.4

2 years ago

7.8.3

2 years ago

7.8.1

2 years ago

7.8.5

2 years ago

7.13.0

2 years ago

7.9.0

2 years ago

7.12.0

2 years ago

7.14.0

2 years ago

7.14.1

2 years ago

7.4.3

2 years ago

7.4.2

3 years ago

7.4.1

3 years ago

7.3.0

3 years ago

7.4.0

3 years ago

7.0.0-alpha.2

3 years ago

7.1.2-alpha.1

3 years ago

7.1.2-alpha.0

3 years ago

7.0.0

3 years ago

7.1.2

3 years ago

7.1.1

3 years ago

7.1.0

3 years ago

7.2.1

3 years ago

7.2.0

3 years ago

6.0.0-alpha.0

3 years ago

6.0.0-alpha.1

3 years ago

6.2.2-alpha.0

3 years ago

5.13.2-alpha.1

3 years ago

6.0.1

3 years ago

6.0.0

3 years ago

5.11.9

3 years ago

5.11.8

3 years ago

5.11.7

3 years ago

5.11.6

3 years ago

5.11.5

3 years ago

7.0.0-alpha.1

3 years ago

7.0.0-alpha.0

3 years ago

6.1.0

3 years ago

5.11.4

3 years ago

5.11.3

3 years ago

5.11.2

3 years ago

5.11.1

3 years ago

6.2.1

3 years ago

6.2.0

3 years ago

5.12.0

3 years ago

6.3.0

3 years ago

5.13.2

3 years ago

5.13.1

3 years ago

5.13.0

3 years ago

6.4.3

3 years ago

6.4.2

3 years ago

6.4.1

3 years ago

6.4.0

3 years ago

5.14.1

3 years ago

5.14.0

3 years ago

5.11.0

3 years ago

5.10.3-alpha.1

3 years ago

5.10.6

3 years ago

5.10.5

3 years ago

5.10.4

3 years ago

5.10.3

3 years ago

5.10.2

3 years ago

5.10.1

3 years ago

5.8.1

3 years ago

5.9.0

3 years ago

5.10.0

3 years ago

5.8.0

4 years ago

5.7.3

4 years ago

5.7.2

4 years ago

5.7.1

4 years ago

5.7.0

4 years ago

5.6.1

4 years ago

5.6.0

4 years ago

5.5.0

4 years ago

5.4.6

4 years ago

5.4.5

4 years ago

5.4.4

4 years ago

5.4.3

4 years ago

5.4.2

4 years ago

5.3.0

4 years ago

5.4.1

4 years ago

5.4.0

4 years ago

5.1.0

4 years ago

5.2.0

4 years ago

5.0.3

4 years ago

5.0.0-alpha.7

4 years ago

5.0.0-alpha.6

4 years ago

5.0.0-alpha.5

4 years ago

5.0.0-alpha.4

4 years ago

5.0.0-alpha.9

4 years ago

5.0.0-alpha.8

4 years ago

5.0.0-beta.2

4 years ago

5.0.0-beta.1

4 years ago

5.0.0-alpha.3

4 years ago

5.0.0-alpha.2

4 years ago

5.0.2

4 years ago

5.0.1

4 years ago

5.0.0

4 years ago

5.0.2-alpha.1

4 years ago

5.0.0-alpha.10

4 years ago

4.11.1-0

4 years ago

5.0.1-alpha.2

4 years ago

5.0.1-alpha.1

4 years ago

5.0.1-alpha.5

4 years ago

5.0.1-alpha.4

4 years ago

5.0.1-alpha.3

4 years ago

4.11.1

4 years ago

4.11.2

4 years ago

4.11.0

4 years ago

4.10.1

4 years ago

4.10.0

4 years ago

4.9.2

4 years ago

4.9.1

4 years ago

4.9.0

4 years ago

4.9.0-canary.0

4 years ago

4.8.1

4 years ago

4.8.0

4 years ago

4.7.0

4 years ago

4.7.1

4 years ago

4.6.1

4 years ago

4.6.0

4 years ago

4.5.0

5 years ago

4.5.0-canary.2

5 years ago

4.4.0

5 years ago

4.2.1-canary.0

5 years ago

4.2.1-canary.2

5 years ago

4.2.1-canary.3

5 years ago

4.3.0

5 years ago

4.2.0

5 years ago

4.1.0-canary.2

5 years ago

4.1.1-canary.0

5 years ago

4.1.0

5 years ago

4.1.1

5 years ago

4.1.0-canary.1

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0-canary.23

5 years ago

4.0.0-canary.22

5 years ago

4.0.0

5 years ago

4.0.0-canary.20

5 years ago

4.0.0-canary.19

5 years ago

4.0.0-canary.17

5 years ago

4.0.0-canary.16

5 years ago

4.0.0-canary.14

5 years ago

4.0.0-canary.13

5 years ago

4.0.0-canary.10

5 years ago

4.0.0-canary.9

5 years ago

4.0.0-canary.8

5 years ago

4.0.0-canary.6

5 years ago

4.0.0-canary.0

5 years ago

3.6.1-canary.2

5 years ago

3.6.0

5 years ago

3.6.0-canary.0

6 years ago

3.5.1

6 years ago

3.5.1-canary.20

6 years ago

3.5.0

6 years ago

3.5.0-canary.9

6 years ago

3.4.4-71d48a96.0

6 years ago

3.4.4-a9fb8da1.0

6 years ago

3.4.4-ca7e506a.0

6 years ago

3.4.4-0b6223c4.0

6 years ago

3.4.4-e1839b43.0

6 years ago

3.4.3

6 years ago

3.4.3-cfbe4783.0

6 years ago

3.4.3-f130c101.0

6 years ago

3.4.3-695b2acc.0

6 years ago

3.4.3-53abf21e.0

6 years ago

3.4.3-bb90b83d.0

6 years ago

3.4.3-5f1a38fa.0

6 years ago

3.4.3-20c504bd.0

6 years ago

3.4.2

6 years ago

3.4.2-0668aca8.0

6 years ago

3.4.3-efa33040.0

6 years ago

3.4.2-1963d180.0

6 years ago

3.4.2-dev.1

6 years ago

3.4.2-dev.0

6 years ago

3.4.0

6 years ago

3.3.0

6 years ago

3.3.0-alpha.0

6 years ago

3.2.4

6 years ago

3.2.3

6 years ago

3.2.2-alpha.0

6 years ago

3.2.2

6 years ago

3.2.1

6 years ago

3.2.0

6 years ago

3.1.1-alpha.1

6 years ago

3.1.1-alpha.0

6 years ago

3.1.0

6 years ago

3.0.3-alpha.1

6 years ago

3.0.3-alpha.0

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

3.0.0-beta.5

6 years ago

3.0.0-beta.4

6 years ago

3.0.0-beta.3

6 years ago

3.0.0-beta.1

6 years ago

3.0.0-beta.0

6 years ago

3.0.0-alpha.4

6 years ago

3.0.0-alpha.3

6 years ago

3.0.0-alpha.2

6 years ago

3.0.0-alpha.1

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

1.0.6-alpha.0

6 years ago

1.0.5-alpha.0

6 years ago

1.0.4-alpha.0

6 years ago

1.0.3-alpha.0

6 years ago

1.0.1-alpha.0

6 years ago

1.0.0-alpha.0

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago