@mantine/core package exports several components that can help you organize responsive styles without writing CSS.
Note that in most cases that are not covered in this guide, the best way to make your app responsive is to
add styles with createStyles function.
theme.breakpoints are used in all responsive Mantine components. Breakpoints are set in px (rem, em and other values are not supported).
You can configure these values with MantineProvider:
In most cases using createStyles function is cleanest way to add responsive styles to any element. Consider using it first before hacking your way out of writing CSS with other approaches:
MediaQuery component lets you apply styles to given component or element if given media query matches:
Most of Mantine components support
size prop with
You cannot change these values within component props. Instead you can use MediaQuery component
to render different components based on media query:
All Mantine components support
sx prop with which you can add styles (including responsive styles) to root component element:
If you want to add styles with
sx prop to non-Mantine component, you can wrap it in Box: