Skip to main content

hooks

🤏 use-grid‌ exports several hooks that can handle different gestures.

HookDescription
useGridmake it switch value by media query using useEffect
useGridsmultiple values can be switched by media queries
useMediaget a match to media query using useEffect
useViewget a flag whether the target intersects
useLayoutGridwork like useGrid using useLayoutEffect
useLayoutGridswork like useGrids using useLayoutEffect
useLayoutMediawork like useMedia using useLayoutEffect
useLayoutViewwork like useView using useLayoutEffect

Usage#

🤏 use-grid
  • props is an object all prefix if the grid.
  • ref is one or more React.RefObject or Element as target.
  • config is an object containing options for the grid.