Skip to content
Playground

Breakpoints

Shared viewport thresholds and responsive patterns for Zenos layouts and applications.

Zenos uses a mobile-first breakpoint scale shared by layout props and Tailwind utilities. Start with the narrowest useful layout, then add a breakpoint only when the content needs more room or a different structure.

Each breakpoint is a min-width media query. The bar shows where each one begins relative to the 2xl ceiling.

Responsive breakpoint minimum widths
Breakpoint Relative minimum width Minimum pixels
sm 40rem ≥ 640px
md 48rem ≥ 768px
lg 64rem ≥ 1024px
xl 80rem ≥ 1280px
2xl 96rem ≥ 1536px

The pixel values assume the browser’s standard 16px root size and are shown as a convenient reference. Zenos consumes Tailwind’s rem-based default breakpoints rather than maintaining a separate set of device-specific thresholds.

base is a responsive-prop key, not a Tailwind prefix. It produces unprefixed styles that apply everywhere until a larger breakpoint overrides them.

Breakpoint rules use min-width. A value begins at its breakpoint and remains active at larger widths until another value overrides it.

TSX
<Grid columns={{ base: 1, md: 2, xl: 4 }} gap={{ base: "3", lg: "6" }}>  {children}</Grid>

This grid has one column by default, two columns from md, and four columns from xl. Its gap changes from 3 to 6 at lg. Omitted breakpoints inherit the last applicable value through CSS.

Always provide a usable base layout when the value must change responsively. Do not use sm as shorthand for mobile: sm starts at 640px, while the unprefixed value covers widths below it.

Zenos layout primitives accept either a direct value or a responsive object for the properties they own. The public Responsive<T> type supports base, sm, md, lg, xl, and 2xl.

TSX
import { Container, Grid, GridSpan, Stack } from "@zentara-co/zenos-ui"; <Container size="xl">  <Grid columns={{ base: 1, lg: 12 }} gap={{ base: "4", lg: "6" }}>    <GridSpan columns={{ base: 1, lg: 8 }}>      <MainContent />    </GridSpan>    <GridSpan columns={{ base: 1, lg: 4 }}>      <SupportingPanel />    </GridSpan>  </Grid>   <Stack    direction={{ base: "column", sm: "row" }}    align={{ base: "stretch", sm: "center" }}    gap="3"  >    <PrimaryAction />    <SecondaryAction />  </Stack></Container>;

Prefer responsive props when a layout primitive owns the behavior. This keeps structure typed and makes the breakpoint decision visible at the call site.

Use the matching Tailwind prefixes for application-specific layout and decoration:

TSX
<section className="px-4 py-6 md:px-6 lg:py-10">  <div className="grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4">{children}</div></section>

Unprefixed utilities are the base treatment. Prefixes add overrides at their minimum width. Keep related responsive classes close together so the progression can be read without searching across files.

Use the first breakpoint where the current composition stops working, not a presumed phone, tablet, or desktop model.

  • Let text wrap before increasing the viewport requirement.
  • Add columns only when each column retains a useful readable width.
  • Move actions inline when their labels fit without crowding or truncation.
  • Keep dense data horizontally scrollable when collapsing it would hide meaning.
  • Prefer a container query for a reusable component whose layout depends on its parent rather than the viewport.
  • Avoid adding a different layout at every breakpoint. Most interfaces need only one or two meaningful transitions.

The same viewport can contain a full-width page, a narrow side panel, and an embedded card. Viewport breakpoints cannot describe all three component contexts reliably.

Use responsive props, media queries, or utility prefixes for presentation. CSS responds before paint, works during server rendering, and avoids maintaining duplicate viewport state.

Use viewport hooks only when width must change behavior that CSS cannot express, such as selecting a different interaction model or coordinating imperative third-party code.

APIDefault range
useMobileMode()Below md, through 767px
useTabletMode().isPortraitThrough 1023px, including mobile
useTabletMode().isLandscape1024px through 1279px
useTabletMode().isAnyTabletThrough 1279px
TSX
import { useMobileMode } from "@zentara-co/zenos-ui"; function ResultsInteraction() {  const isMobile = useMobileMode();   return isMobile ? <ResultsSheet /> : <ResultsPopover />;}

The hooks read the visual viewport when available and subscribe to resize changes. Their server value is non-mobile, so the first client render may update after hydration. Do not use them merely to toggle CSS layout or hide presentational content. See Hooks for their complete APIs and SSR behavior.

Responsive presentation must preserve meaning and interaction:

  • Do not hide essential actions, errors, or instructions at narrow widths.
  • Avoid rendering duplicate interactive controls for different breakpoints unless the inactive copy is removed from both layout and the accessibility tree.
  • Keep DOM order logical even when Grid or Flexbox changes visual placement.
  • Preserve focus when changing between responsive interaction patterns.
  • Prefer wrapping and reflow over truncating meaningful content.

Test around the boundary, not only at the named width. For an md change, verify at 767px, 768px, and a comfortably wider size.

Also test:

  • browser zoom up to 200%
  • increased default font size
  • long and translated labels
  • open menus, dialogs, and validation messages
  • keyboard focus order after reflow
  • horizontal overflow in tables, charts, and code examples
  • resizing while temporary UI is open

Breakpoints organize available space; they do not replace resilient content, intrinsic sizing, or accessible reflow.