Skip to content

useBreakpoints ​

Category
Browser

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

NameTypeDefaultNote
breakpointsBreakpoints<Breakpoint>-The breakpoints to use
strategy?UseBreakpointsStrategymin-widthThe strategy to use for matching

Contributors ​

Source • Demo