@brix-ui/hooks
v2.2.2
Published
Batch of useful UI-related React hooks
Downloads
5
Readme
@brix-ui/hooks
Batch of useful UI-related React hooks.
Installation
npm i @brix-ui/hooks # react react-dom
yarn add @brix-ui/hooks # react react-dom
Make sure to have
react
andreact-dom
installed in your package as they are included in our peer dependencies.
Usage
Every hook functions is exported by default and should be used inside React components with respect to the rules of hooks.
import useMediaQuery from '@brix-ui/hooks/use-media-query';
const Component = () => {
const isMd = useMediaQuery('screen and (min-width: 768px)');
// ...
};