Skip to content

Breakpoints

Tailwind's default breakpoints, which of them the components use, and how to build layouts that work from 320px to 1920px.

Silkware does not define its own breakpoints. It uses Tailwind's defaults, and layouts are written mobile first: the base classes are the small layout, and a prefix adds to it from that width up. Every page must work from 320px to 1920px with no horizontal scroll.

Window is at: base

Brescia2 orders waiting
Verona1 order waiting
Mantova1 order waiting
CremonaNothing waiting

The breakpoints

PrefixMinimum widthMedia query
(none)0All widths
sm640pxmin-width: 640px
md768pxmin-width: 768px
lg1024pxmin-width: 1024px
xl1280pxmin-width: 1280px
2xl1536pxmin-width: 1536px

What the components use

The shadcn components in components/ui use only two breakpoints, sm and md, and container queries (@container) for parts that depend on the width of their own parent, such as the card header and the field group. For example, the sidebar turns into a drawer below md, input text goes from 16px to 14px at md, and dialog footers go from a column to a row at sm.

Your own layouts may use any of the six. Prefer sm, md and lg, which cover phone, tablet and laptop.

What the theme changes at a width

Two values in globals.css change at widths of their own, not Tailwind's:

WidthChange
Below 640px--step-display is 40px, --step-lead is 16px and the lead's line height is 1.65.
Below 1240px--header-height is 64px instead of 72px.

Spacing and the large type steps are fluid with clamp(), so they need no breakpoint at all. See Spacing.

Responsive behaviour

Start with the layout for a phone and add what a wider screen can afford. A form stacks on a phone and sits in a row from md:

<form className="flex flex-col gap-4 md:flex-row md:items-end">

Below 640px everything runs full width. A page has one pair of margins at every width (px-page), so the layout never needs a different margin per breakpoint.

Do

Write the phone layout first and add what a wider screen can afford.

Open this order on a larger screen to confirm the supplier.

Don’t

Don’t hide an action on a small screen.

Test at 320px, 375px, 768px, 1280px and 1920px, in light and dark.