useBreakpoint

The

useBreakpoint
hook is used for viewport checks. It uses a resize handler under the hood and thus only works on client-side.

Do's & Don'ts

Don't use it if you can use pure media queries or the

display
prop on Box.

Params

Name
Type
Default
Description
breakpoint*
small

|  
medium

|  
large

|  
huge
The breakpoint which is checked using a mobile-first approach

Returns

bool
: Whether the breakpoint is active or not

Examples