Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Ctrl k
Search...
Sign up
Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Once UIDocumentationBlog
© Once UI. All rights reserved.
Built with Aveiro
Common patterns

Masonry & media grids

MasonryGrid for variable-height galleries; Grid vs masonry decision tree and portfolio cells.
Updated 21d ago
Social proof & logo clouds
Table pagination, search & bulk selection
5 min · Pattern
Uniform Grid columns fit cards of the same height. MasonryGrid packs variable-height media — portfolios, inspiration boards, and mixed aspect shots.

What this pattern covers

Gallery layouts are a common agent trap: teams use CSS Grid with manual row spans when heights differ.
Layout
Component
Best for
Equal-height cards`Grid`Pricing tiers, feature grids
Variable image heights`MasonryGrid`Portfolios, mood boards, Pinterest-style feeds
Single hero + thumbs`Grid` + `Media`Product detail pages
Gold references: packages/core/ai/examples/blocks/Gallery1.tsx (if present in blocks manifest), marketing hero media sections, and catalog entry MasonryGrid.

MasonryGrid API

MasonryGrid is a flex-based masonry packer — pass columns and breakpoint overrides l, m, s, xs. Describe in prose:
  • columns — default column count (often 3 on desktop)
  • gap — spacing token between items (default 8; use 16 for marketing galleries)
  • l / m / s / xs — per-breakpoint { columns: number } objects
Each child is one cell — usually a Card or Media wrapper. Typical desktop → mobile collapse: columns={3} with s={{ columns: 2 }} and xs={{ columns: 1 }}.

Portfolio cell

Wrap each asset in Card when the tile is clickable. Use the Media component for the image (pass src, alt, aspectRatio, and radius) — avoid raw img tags.
<Card href={`/work/${piece.id}`} radius="l" padding="0">
  {/* Media — src, alt, aspectRatio="4 / 3", radius="l" */}
  <Column padding="16" gap="4">
    <Text variant="body-strong-s">{piece.title}</Text>
    <Text variant="body-default-xs" onBackground="neutral-weak">
      {piece.category}
    </Text>
  </Column>
</Card>

Masonry vs Grid decision tree

  • All tiles same structure and height? → Grid with columns prop
  • Mixed aspect ratios, no strict rows? → MasonryGrid
  • Horizontal filmstrip? → Scroller — see Scrolling & feeds
  • Full-bleed carousel? → Carousel & compare media

Section wrapper

Galleries need breathing room — wrap in page Column with section gap:
Use gap="48" between section title and grid per Spacing & rhythm.

Loading gallery skeleton

While assets load, mirror masonry with a Grid of block skeletons (shape described in Loading states) — same columns and gap as the final MasonryGrid so layout does not jump.

Write this / not this

✅ Once UI way
❌ Common mistake
MasonryGrid for mixed heightsGrid + manual `grid-row` spans
Media `aspectRatio` propUnsized images collapsing layout
Card `href` for clickable tiles`div` with `onClick` only
Breakpoint `columns` overridesOne column count for all widths

Check yourself

  • Column counts defined for s and xs
  • Media alt text set for every image
  • Clickable tiles use Card with href or onClick
  • Section title uses display/heading variants, not body text

Related

→ Scrolling & feeds → Media & uploads → Responsive stacking → Full reference: docs.once-ui.com — MasonryGrid
<Column fillWidth gap="48" paddingX="l" maxWidth="xl">
  <Column gap="8">
    <Heading variant="display-strong-s">Selected work</Heading>
    <Text variant="body-default-m" onBackground="neutral-weak">
      Brand, product, and editorial projects.
    </Text>
  </Column>
  {/* MasonryGrid children */}
</Column>