Web · Components
Stack
Lays out items vertically or side by side with equal gaps between them.
Live example
Preview
Code
Events
- Events appear here when you interact with the preview.
Toolbar: push to both ends
Orders
Custom separator, inline
Preview
Card 1
Card 2
Card 3
Card 4
Card 5
Card 6
Code
Events
- Events appear here when you interact with the preview.
Sidebar + content (two columns at md)
Preview
Container: centers, limits the width, leaves side padding.

Code
Events
- Events appear here when you interact with the preview.
Import
Lays out items vertically or side by side with equal gaps between them. Direction, gap and alignment can change with the screen width; you don't need to write responsive classes in className for that.
It is a server component; it contains no client code. Gap numbers are on the Tailwind scale and follow the UIProvider density setting.
Examples
Shows content in a box with a fixed aspect ratio. Since space is reserved before the media loads, the page doesn't shift (CLS). Direct img, video, iframe, picture and canvas children fill the box.
It is a server component; it contains no client code.
Examples
Box that centers page content, limits the maximum width and leaves spacing at the edges. Use it with the same size on the page body, header and footer so they align.
It is a server component; it contains no client code.
Examples
Grid layout. The column count can change with the screen width or adjust itself with minItemWidth without breakpoints. To span an item across several columns give it className="col-span-2" (responsive: md:col-span-2).
It is a server component; it contains no client code.
Examples
Shows or hides content with CSS by screen width. Renders correctly on the server too: unlike useMediaQuery, there is no flicker on first paint or hydration mismatch. Both versions are on the page (only one is visible); if you want to load a heavy interactive component only on one screen, use useMediaQuery.
The wrapping element is display: contents; it doesn't break the layout.
It is a server component; it contains no client code.
Examples
Content that is invisible on screen but read by screen readers: a name for icon-only elements, a table caption, a description for a form section. It is not display: none; the content stays in the accessibility tree.
It is a server component; it contains no client code. If you only need a class, Tailwind's sr-only does the same.
Examples
AspectRatioProps
interfaceProps of the AspectRatio component.
Extends: ComponentProps<"div">
| Name | Type | Default | Description |
|---|---|---|---|
ratio? | Responsive<number | string> | 16 / 9 | Aspect ratio: a number (16 / 9, 1) or a string ("4/3"). Can be responsive: { base: 1, md: 16 / 9 } (square on mobile, landscape on wide screens). |
fit? | "cover" | "contain" | "cover" | How an image, video or iframe inside fills the box: cover fills by cropping, contain fits it whole. |
ContainerSize
typeContainer width: sm 42rem, md 56rem, lg 72rem, xl 80rem, 2xl 96rem, prose a readable text line (~65 characters), full unlimited.
ContainerProps
interfaceProps of the Container component.
Extends: ComponentProps<"div">
| Name | Type | Default | Description |
|---|---|---|---|
size? | ContainerSize | "xl" | Maximum width. See ContainerSize. |
gutter? | boolean | true | Horizontal padding: 1rem on mobile, 1.5rem at sm, 2rem at lg. false disables it (e.g. for edge-to-edge media). |
query? | boolean | string | false | Makes it a container query root (container-type: inline-size): elements inside change by this box's width, not the screen, with classes like @md:. With a name ("card") select it with @md/card:. |
as? | LayoutElement | "div" | Element to render (main, section…). |
GridProps
interfaceProps of the Grid component.
Extends: ComponentProps<"div">
| Name | Type | Default | Description |
|---|---|---|---|
columns? | Responsive<number | string> | 1 | Columns: a number is the count of equal-width columns, a string is used as is as the grid-template-columns value ("240px 1fr"). Can be responsive: { base: 1, sm: 2, lg: 4 }. Ignored if minItemWidth is given. |
minItemWidth? | LayoutSpace | A responsive grid without breakpoints: each column is at least this wide, and as many columns open as fit (ideal for card lists). A number is the Tailwind scale (64 = 16rem), a string a CSS length ("14rem"). If the container is narrower than this width it becomes one column without overflowing. | |
autoFlow? | "fill" | "fit" | "fill" | With minItemWidth, if the items don't fill the columns: fill keeps the empty columns (items keep the same width), fit spreads the items across the row. |
gap? | Responsive<LayoutSpace> | 4 | Gap between rows and columns (see Stack gap). |
rowGap? | Responsive<LayoutSpace> | Gap between rows only; overrides gap. | |
columnGap? | Responsive<LayoutSpace> | Gap between columns only; overrides gap. | |
align? | Responsive<StackAlign> | "stretch" | Vertical alignment within a cell (align-items). |
justifyItems? | Responsive<Exclude<StackAlign, "baseline">> | "stretch" | Horizontal alignment within a cell (justify-items). |
dense? | boolean | false | If true, empty cells are filled with later smaller items (grid-auto-flow: dense); the order may change. |
as? | LayoutElement | "div" | Element to render. |
Breakpoint
typeTailwind's default breakpoints (sm 40rem … 2xl 96rem).
Responsive
typeA single value or values that change with the screen width.
In object form base is the value for the narrowest screen; each breakpoint applies from that width up, and a missing breakpoint carries the previous one (like Tailwind's md: prefixes, mobile first). Breakpoints are Tailwind's defaults: sm 40rem, md 48rem, lg 64rem, xl 80rem, 2xl 96rem.
Examples
LayoutSpace
typeSpacing value: a number is the Tailwind spacing scale (4 = gap-4 = 1rem, follows the density setting), a string is used as is as a CSS length ("2.5rem", "5%").
ShowProps
interfaceProps of the Show component.
| Name | Type | Description |
|---|---|---|
above? | Breakpoint | Shows at this breakpoint and above ("md" = 48rem and up). |
below? | Breakpoint | Shows below this breakpoint ("md" = narrower than 48rem). |
children? | ReactNode | Content to show. |
StackDirection
typeDirection in which items inside a Stack are laid out.
StackAlign
typeAlignment on the cross axis (align-items): horizontal in a column, vertical in a row. stretch stretches the items.
StackJustify
typeDistribution on the main axis (justify-content): between puts space between, around around, evenly equal space.
LayoutElement
typeElement to render.
StackProps
interfaceProps of the Stack component.
Extends: ComponentProps<"div">
| Name | Type | Default | Description |
|---|---|---|---|
direction? | Responsive<StackDirection> | "column" | Layout direction; can change with the screen width ({ base: "column", md: "row" }). See Responsive. |
gap? | Responsive<LayoutSpace> | 4 | Gap between items: a number is the Tailwind scale (4 = 1rem, follows the density setting), a string a CSS length ("2.5rem"). Can be responsive. |
align? | Responsive<StackAlign> | "stretch" | Alignment on the cross axis. See StackAlign. |
justify? | Responsive<StackJustify> | "start" | Distribution on the main axis. See StackJustify. |
wrap? | Responsive<boolean> | false | Should items that don't fit wrap to the next line? For tag and button lists in the row direction. |
separator? | boolean | ReactNode | Puts a divider between items: true a thin line in the border color, or the given element (e.g. <span>·</span>). Even if the direction changes, the divider adjusts itself (horizontal in a column, vertical in a row). | |
as? | LayoutElement | "div" | Element to render (ul, nav, section…). |
inline? | boolean | false | If true, it behaves like an inline element (inline-flex); for small groups like icon + text inside a sentence. |
VisuallyHiddenProps
interfaceProps of the VisuallyHidden component.
Extends: ComponentProps<"span">
| Name | Type | Default | Description |
|---|---|---|---|
focusable? | boolean | false | Become visible on keyboard focus? Use it with as="a" for a "Skip to content" link (skip link). |
as? | "span" | "div" | "a" | "h1" | "h2" | "h3" | "p" | "label" | "span" | Element to render. |
href? | string | Link URL when as="a". |