- Grid is for uniform layouts. You set a column count and children flow in left-to-right, wrapping to new rows automatically. Every child gets the same column width. Use Grid when you have a collection of same-shaped items — a card grid, a gallery, a set of form fields.
- Dashboard is for composed layouts where items have different sizes and specific positions. A chart might span 8 of 12 columns while stat cards stack in the remaining 4. A table might stretch the full width below. You place each item at exact grid coordinates and control how many columns and rows it spans.
columns count and a row_height, then wrap each piece of content in a DashboardItem that declares its position (col, row) and size (col_span, row_span). Coordinates are 1-indexed, matching CSS Grid conventions.
Basic Usage
A Dashboard needs acolumns count and a row_height (in pixels by default). Each child DashboardItem declares where it sits on the grid. Here, a 4-column grid places four blocks: A spans 2 columns across the top-left, B fills the top-right, C occupies a single cell on the second row, and D stretches across the remaining 3 columns.
Dashboard Layout
A common dashboard pattern uses a 12-column grid (like Bootstrap’s grid system) to mix wide and narrow elements. The trick is planning your rows: the chart card starts at column 1 and spans 8 of the 12 columns, while three stat cards stack in the remaining 4 columns (columns 9-12). Each stat card takes one row; the chart spans all three rows so it lines up with them. A full-width table sits below in row 4. To make children fill their grid cells, usecss_class="h-full" on the content inside each DashboardItem.
Row Height
By default, every row in the grid is the same height — set byrow_height in pixels. An item with row_span=2 gets twice that height (plus one gap). The tabs below show the same layout at 80px and 150px row heights: same positions, different vertical scale.
- 80px rows
- 150px rows
Content-sized rows
Pass a string instead of an integer for CSS values.row_height="auto" makes each row size to its tallest item — so a row with a paragraph of text will be taller than a row with a single line. This is useful when your dashboard items have varying content and you want the grid to adapt rather than forcing fixed cells.
You can also use row_height="minmax(80px, auto)" to set a minimum height while still allowing rows to expand for taller content.
Layering
When items overlap on the grid (their column/row ranges intersect), they stack visually. By default, later items render on top of earlier ones. Usez_index to control the stacking order explicitly — higher values render on top.
API Reference
Dashboard Parameters
Number of grid columns.
Height of each auto-generated row. Integer for pixels, string for any CSS value (e.g.
"auto", "minmax(100px, auto)").Fixed number of rows. When set, uses
grid-template-rows instead of grid-auto-rows. Omit for auto-expanding rows.Gap between items. An int maps to
gap-{n}. A tuple (x, y) sets per-axis gaps.Additional Tailwind CSS classes.
DashboardItem Parameters
Starting column (1-indexed).
Starting row (1-indexed).
Number of columns to span.
Number of rows to span.
CSS z-index for layering overlapping items.
Additional Tailwind CSS classes.
Protocol Reference
Dashboard
DashboardItem