Skip to content

Block 243 of 297

Dashboard Grid

The layout for dashboard widgets: a titled section with a drop zone that arranges widgets in 1–4 columns.

Puck key
DashboardGridBlock
Export
dashboardGridBlock
React component
<DashboardGrid />
Path
components/puck/dashboard-grid-block.tsx
Dependencies
None
License
MIT

About this block

When to use it, how to write for it, and what to change in the code.

What it's for

The container for dashboard widgets: a section with an optional heading, description, last-updated line and action link, plus a drop zone that lays out whatever widgets you place in it. Set one to four desktop columns; widgets drop to one column on phones. A grid with no header tucks up under the grid above it, so you can stack rows with different column counts.

  • A public impact or program results page built from KPI cards and charts
  • An internal board report with several rows of widgets
  • A data transparency page with a CSV download
Writing the content
  • Bind Last updated to your source's timestamp, like {{ metrics.updated_at }}, so the date never goes stale.
  • Use a second Dashboard Grid with no Heading for a row that needs a different column count; it drops its top padding to read as a continuation.
  • Four columns suits small KPI cards. Charts and tables usually need two or three to stay legible.
  • Action link text hides when blank; "Download data (CSV)" gives visitors the numbers behind the charts.
Accessibility
  • The Heading level setting (H1 to H4) places the dashboard in the page outline; set widgets inside to the next level down, usually H3 (WCAG 1.3.1).
  • The pulsing dot beside Last updated is aria-hidden and stops animating for visitors who prefer reduced motion.
  • The action link has a 44px minimum height and a visible focus outline.
Customizing the code
  • Column breakpoints live in the COLUMNS map, for example 4 is grid-cols-1 sm:grid-cols-2 xl:grid-cols-4.
  • Widgets detect the grid through the data-dashboard-grid attribute; keep it on the section if you restyle it.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Headingtext
  • Heading levelselect
  • Descriptiontextarea
  • Last updatedtext
  • Action link texttext
  • Action linktext
  • Columns (desktop)select
  • Backgroundradio
  • Widgetsslot