Search code examples
antd

Does ant design have a similar breakpoint check analagous to material-ui?


Material UI has a handy function of checking for breakpoints for example.

const matchesSM = useMediaQuery(theme.breakpoints.down("sm"));

So if the screen size goes below sm then matchesSM becomes true.

Does Ant Design have a similar feature?


Solution

  • Yes. It's called useBreakpoint. Here's the doc: https://ant.design/components/grid/#components-grid-demo-useBreakpoint