AhaSlides Design
v0.52.0React · Vue · Lit

Components · Layout

Grid

A CSS-grid container — a fixed column count or a responsive auto-fit, with the DS gutter scale, track justify/align, and a responsive collapse.

Examples

Columns
Gutter
Justify
Responsive collapse
Grid · fixed columns · gutter [h,v] · justify / align · responsive collapse
Poll
Quiz
Word cloud
Q&A
Brainstorm
Spinner
Responsive · min 200 · gap large
Auto A
Auto B
Auto C
Auto D

API

PropTypeDefaultNotes
columnsnumberFixed number of equal-width columns (minmax(0, 1fr) tracks)
minnumberMinimum track width for a responsive auto-fit grid; wins over columns
gapnone | small | middle | large | number | "h v"0Gutter between cells — a named DS step (8/16/24) / raw px, or two values "h v" for a separate horizontal/vertical gutter
guttersame as gapAlias of gap (AntD Row vocabulary); gap wins if both are set
justifystart | center | end | space-between | space-around | space-evenlyHorizontal distribution of the tracks (justify-content)
alignstart | center | end | stretchVertical alignment of the cells within their row (align-items)
responsivebooleanfalseWith columns=N, lets tracks collapse to fewer as the container narrows — no media queries

Install

# .npmrc — once: point the @ahaslides-product scope at GitHub Packages
@ahaslides-product:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}   # a GitHub token with read:packages

npm i @ahaslides-product/design
import '@ahaslides-product/design/tokens.css';   // once, at the app root
import '@ahaslides-product/design/aha-grid';   // registers <aha-grid>

Agent feed for this component (absolute, fetchable anywhere): grid.agent.json · grid.md · grid.llms.txt

When to use

When to use
  • Grid — a two-dimensional layout — a card gallery, a stat row, an image grid
  • Flex — a one-dimensional flow where items size to content
  • min (auto-fit) — the column count should follow the container width — prefer it over media queries
Reach for `min` (auto-fit) or `responsive` before hand-writing breakpoints — the grid reflows itself. Use `gap="h v"` when rows need tighter spacing than columns. Keep gutters on the named scale so spacing matches the rest of the surface. Grid is layout, never decoration: it paints no background.
Surfaces
editor dashboard settings audience

Spec

Display grid · Columns columns=N → repeat(N, minmax(0, 1fr)) · Auto-fit min=W → repeat(auto-fit, minmax(W, 1fr)) · Responsive collapse columns=N + responsive → tracks reflow to fewer as the container narrows · Gutter scale none 0 · small 8 · middle 16 · large 24 (or a raw px number) · Gutter [h,v] gap="h v" → separate column-gap / row-gap · Justify start · center · end · space-between · space-around · space-evenly (justify-content) · Align start · center · end · stretch (align-items)