useBreakpoints ​
Hook that manages breakpoints
typescript
import { useBreakpoints } from '@siberiacancode/reactuse';
Usage ​
typescript
const { greaterOrEqual, smallerOrEqual, current } = useBreakpoints({ mobile: 0, tablet: 640, laptop: 1024, desktop: 1280 });
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
breakpoints | Breakpoints<Breakpoint> | - | The breakpoints to use |
strategy? | UseBreakpointsStrategy | min-width | The strategy to use for matching |