Breakpoints
Responsive breakpoints for building adaptive layouts.
Live demo
Current breakpoint
defaultBelow extra extra small?
falseBelow extra small?
falseBelow small?
falseBelow medium?
falseBelow large?
falseResize your browser window to see the values change in real-time.
Breakpoint values
Mantle has seven breakpoints. The default row is the unprefixed base, which applies at every width:
xs (480px) is wider than most phones, so a class with only an xs: value applies nothing on a phone. Give an unprefixed base value first, then override it at the breakpoint: flex-col xs:flex-row.
Minimum supported width
Design for a viewport 320px (20rem) wide and wider. This floor applies to mantle, the docs and marketing sites, and the ngrok app.
At 320px, the page doesn't scroll sideways and no content is cut off. A table, a code block, or a tab list can scroll inside its own box. Below 320px, a layout problem isn't a bug.
320px is the width that WCAG 2.2 Reflow (1.4.10) requires: a 1280px window zoomed to 400%.
The unprefixed styles cover every width below 2xs (360px), so check them at 320px, not at a typical phone width.
useBreakpoint hook
The useBreakpoint hook returns the largest breakpoint that the viewport width matches.
Every caller shares one app-wide subscription to the breakpoint media queries. On the server and during hydration, the hook returns "default". After hydration, it returns the breakpoint of the viewport.
Return value
A Breakpoint: "default", "2xs", "xs", "sm", "md", "lg", "xl", or "2xl".
useIsBelowBreakpoint hook
The useIsBelowBreakpoint hook returns true while the viewport is narrower than the given breakpoint. On the server and during hydration, it returns false.
Parameters
A TailwindBreakpoint: "2xs", "xs", "sm", "md", "lg", "xl", or "2xl".
Hooks or classes
Use a hook when the component tree changes at a breakpoint, as in the sidebar above. For a style change, use a breakpoint class such as md:hidden. CSS applies at first paint. A hook value changes only after hydration, so in a server-rendered app a phone first shows the desktop layout.