Layout

Flexbox

The layout element itself — flex or grid, with per-device direction, gap and alignment; grid tiles that span columns and rows (bento layouts); an exact custom gap; and a link that makes the whole box clickable.

Live demo

See it in action

Grid spans

Bento grids, with spans and a box link.

A 3-column Grid with 180px rows and an exact 18px gap. The first tile spans 2 columns and 2 rows; the last spans the full row. The green tile is one big link — and the button inside it still has its own.

2 × 2 tileGrid Column Span 2 + Grid Row Span 2. The whole tile is a link.Its own button →
TileAuto placement.
TileFills the hole beside the big tile.
Full rowGrid Column Span: Full row.

Responsive · Large Desktop

One, two, three, four — across every breakpoint.

Each card’s Width is per device: full on Phone, 1/2 on Tablet, 1/3 on Desktop and 1/4 on Large Desktop (≥1200px) — the new fourth responsive tier. Widen the window past 1200px, or pick the builder’s Large Desktop preview, to see four across. Max Width, Prevent Shrinking and Position (sticky on desktop, static on phone) are now per device too.

Card 11/1 · 1/2 · 1/3 · 1/4
Card 21/1 · 1/2 · 1/3 · 1/4
Card 31/1 · 1/2 · 1/3 · 1/4
Card 41/1 · 1/2 · 1/3 · 1/4
Card 51/1 · 1/2 · 1/3 · 1/4
Card 61/1 · 1/2 · 1/3 · 1/4
Card 71/1 · 1/2 · 1/3 · 1/4
Card 81/1 · 1/2 · 1/3 · 1/4

Inline Flex & Grow Factor

Inline-level flex, and proportional growth.

The pill is a single Inline Flex box — a flex container that sits inline in the text flow. The three bars below use exact Grow Factors 1, 2 and 3, so the second grows twice and the third three times as fast as the first.

★ Inline Flex
flows inline with this text, and so does
this one
Grow 1Grow Factor 1
Grow 2Grow Factor 2
Grow 3Grow Factor 3

Direction

A row on desktop, a stack on phones.

Direction is per device: Column on Phone, Row from Tablet up. Resize the window to watch the three cards re-flow.

PlanSet Direction → Phone: Column.
BuildTablet: Row.
ShipNothing else to configure.

Justify

Distribute children along the row.

The same three chips with Justify set to Start, Center, Space between and Space evenly.

Start

One Two Three

Center

One Two Three

Space between

One Two Three

Space evenly

One Two Three

Align

Line children up on the cross axis.

A tall card next to two short ones: Align items set to Start, Center and Stretch (equal heights).

Start

TallThree lines of text make this card the tallest of the three.
ShortOne line.
ShortOne line.

Center

TallThree lines of text make this card the tallest of the three.
ShortOne line.
ShortOne line.

Stretch

TallThree lines of text make this card the tallest of the three.
ShortOne line.
ShortOne line.

Wrap + Flex Basis

Cards that wrap on their own.

Each card: Flex Basis 240px, Grow to Fill on, Min Width 200px. The row wraps as space runs out — no breakpoints.

DiscoverBasis 240px, grows to fill.
DesignBasis 240px, grows to fill.
DevelopBasis 240px, grows to fill.
DeployBasis 240px, grows to fill.
MeasureBasis 240px, grows to fill.

Grow & shrink

A fixed sidebar beside a flexible main.

Sidebar: Width 260px + Prevent Shrinking. Main: Grow to Fill. Stacks on phones.

SidebarFixed at 260px — it never squeezes.
Main contentGrow to Fill takes every pixel the sidebar leaves. Widen the window: only this side grows.

Auto-fit grid

As many columns as fit.

Display: Grid with Auto-fit on and a 200px Min Column Width — columns appear and disappear as the width changes.

Item 1minmax(200px, 1fr)
Item 2minmax(200px, 1fr)
Item 3minmax(200px, 1fr)
Item 4minmax(200px, 1fr)
Item 5minmax(200px, 1fr)
Item 6minmax(200px, 1fr)
Item 7minmax(200px, 1fr)
Item 8minmax(200px, 1fr)

Grid placement

Put a tile exactly where it belongs.

A 12-column grid. Grid Column Start + Grid Column Span place each bar without spacer cells; Grid Row Start pins the last one to row 2.

Start 1 · Span 4grid-column: 1 / span 4
Start 6 · Span 7Skips columns 5 — no empty cell needed.
Start 3 · Span 8A centred-ish bar on row 2.
Row 2 · Start 11 · Span 2Grid Row Start 2 + Column Start 11: the end of row 2.

Reverse & order

Change the visual order without touching the markup.

From tablet up the row is reversed, so the image sits on the right. On phones the text comes first via Order. The HTML order never changes.

1 · Image (first in the HTML)
2 · Text (second in the HTML)Phone: Order 1 puts this first. Desktop: Reverse Order puts it on the left.

Content Width

Cap a box and choose where it sits.

Three boxes capped to the Narrow width, aligned Left, Center and Right inside the full row.

Narrow · LeftContent Width: Narrow, Content Width Alignment: Left.
Narrow · CenterContent Width: Narrow, Content Width Alignment: Center.
Narrow · RightContent Width: Narrow, Content Width Alignment: Right.

Min height + centring

A centred hero in one box.

Min Height 360px, Justify center and Align center on a Column, over a gradient Background.

Get started

Backdrop blur

Frosted glass over a busy background.

A translucent white Background + Backdrop Blur 14px on the inner box, sitting on a colourful gradient.

Glass cardBackdrop Blur: 14px · Background: white at 45%.

Aspect ratio

Boxes that keep their shape.

Aspect Ratio 1, 16 / 9 and 4 / 5 — the height follows the width at every screen size.

1
16 / 9
4 / 5

HTML tag

The right element for each box.

The same Flexbox renders as a header, nav, main, article, aside or footer element. Pick the HTML Tag and keep every layout option.

<header>Page or card header
<main>The main content
<article>Self-contained content
<footer>Closing details

Place every element exactly where you want it.

Freeform

Set a Div's Display to Freeform and drag its elements anywhere in the Live Editor, with snapping guides and layers. Narrow the window (or open this on a phone): below tablet size the same elements stack in reading order.

A headline that overlaps the picture

Each element keeps its own place: left and width in % of the section, top in pixels, and a layer, so the headline can sit over the circle behind it.

Read the docs

The markup

Clean, lean code

This is the exact HTML the element outputs, straight from the page builder. No wrapper soup, no inline-style bloat.

<section class="fw-flexbox upw-section upw-band-surface fw-flex fw-flex-column fw-gap-md fw-full-bleed fw-collapse">
	<div class="heading heading-h2 heading--space-tight mb-4">
		<p class="heading-overline heading-overline--kicker text-center">Grid spans</p>
		<h2 class="heading-title text-center">Bento grids, with spans and a box link.</h2>
		<p class="heading-subtitle text-center">A 3-column Grid with 180px rows and an exact 18px gap. The first tile spans 2 columns and 2 rows; the last spans the full row. The green tile is one big link — and the button inside it still has its own.</p>
	</div>
	<div class="fw-flexbox sc-bento-demo fw-grid fw-grid-3 fw-grid-collapse" style="grid-auto-rows:180px;">
		<div class="fw-flexbox fw-flexbox--linked">
			<a class="fw-flexbox__link" href="https://unysonplus.github.io/docs/" aria-label="Open the Flexbox documentation"></a>
			<div style="height:100%;box-sizing:border-box;border:1px solid #e7e8e9;border-radius:14px;padding:1.2rem 1.3rem;background:#eef7f4">
				<strong style="display:block;font-size:1.25rem;color:#1c1e22">2 × 2 tile</strong>
				<span style="display:block;color:#5f6266;margin-bottom:.8rem">Grid Column Span 2 + Grid Row Span 2. The whole tile is a link.</span>
				<a href="#sec-bento" style="display:inline-block;padding:.45rem .9rem;border-radius:999px;background:#1c1e22;color:#fff;text-decoration:none;font-size:.85rem">Its own button →</a>
			</div>
		</div>
		<div class="fw-flexbox">
			<div style="height:100%;box-sizing:border-box;border:1px solid #e7e8e9;border-radius:14px;padding:1.2rem 1.3rem;background:#f3f6fb">
				<strong style="display:block;color:#1c1e22">Tile</strong>
				<span style="color:#5f6266">Auto placement.</span>
			</div>
		</div>
		<div class="fw-flexbox">
			<div style="height:100%;box-sizing:border-box;border:1px solid #e7e8e9;border-radius:14px;padding:1.2rem 1.3rem;background:#f3f6fb">
				<strong style="display:block;color:#1c1e22">Tile</strong>
				<span style="color:#5f6266">Fills the hole beside the big tile.</span>
			</div>
		</div>
		<div class="fw-flexbox">
			<div style="height:100%;box-sizing:border-box;border:1px solid #e7e8e9;border-radius:14px;padding:1.2rem 1.3rem;background:#fbf6ee">
				<strong style="display:block;color:#1c1e22">Full row</strong>
				<span style="color:#5f6266">Grid Column Span: Full row.</span>
			</div>
		</div>
	</div>
</section>

To learn more about the Flexbox shortcode, please check out the online manual here.

Free & open source

Build with this element, free.

Install the framework and the Bootstrap 5 theme, then drag this element into any page.