Data grid
Use the data grid component to display detailed information about your product. The data is displayed as a column of items consisting of a title and content.
Overview
Use the .datagrid class to lay out label and value pairs. Each pair is a .datagrid-item with a .datagrid-title for the label and a .datagrid-content for the value.
The datagrid is a CSS grid that fits as many columns as the available width allows, so it reflows on its own - there is nothing to set per breakpoint.
<div class="datagrid">
<div class="datagrid-item">
<div class="datagrid-title">Registrar</div>
<div class="datagrid-content">Third Party</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Port number</div>
<div class="datagrid-content">3306</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Age</div>
<div class="datagrid-content">15 days</div>
</div>
</div>Content types
A value is a plain container, so it takes anything: text, avatars, statuses, icons or form controls. Mixing them keeps a detail panel compact.
<div class="datagrid">
<div class="datagrid-item">
<div class="datagrid-title">Registrar</div>
<div class="datagrid-content">Third Party</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Nameservers</div>
<div class="datagrid-content">Third Party</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Port number</div>
<div class="datagrid-content">3306</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Expiration date</div>
<div class="datagrid-content">–</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Creator</div>
<div class="datagrid-content">
<div class="d-flex align-items-center">
<span class="avatar avatar-xs me-2 rounded" style="background-image: url(/static/avatars/027m.jpg)"></span> Paweł Kuna
</div>
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Age</div>
<div class="datagrid-content">15 days</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Edge network</div>
<div class="datagrid-content">
<span class="status status-green">Active</span>
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Avatars list</div>
<div class="datagrid-content">
<div class="avatar-list avatar-list-stacked">
<span class="avatar avatar-xs rounded" style="background-image: url(/static/avatars/029f.jpg)"></span>
<span class="avatar avatar-xs rounded">JL</span>
<span class="avatar avatar-xs rounded" style="background-image: url(/static/avatars/015f.jpg)"></span>
<span class="avatar avatar-xs rounded" style="background-image: url(/static/avatars/004m.jpg)"></span>
<span class="avatar avatar-xs rounded" style="background-image: url(/static/avatars/037m.jpg)"></span>
<span class="avatar avatar-xs rounded">+3</span>
</div>
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Checkbox</div>
<div class="datagrid-content">
<label class="form-check">
<input class="form-check-input" type="checkbox" checked />
<span class="form-check-label">Click me</span>
</label>
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Icon</div>
<div class="datagrid-content">
<!-- Download SVG icon from http://tabler.io/icons/icon/check -->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="icon text-green icon-inline">
<path d="M5 12l5 5l10 -10" />
</svg> Checked
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Form control</div>
<div class="datagrid-content">
<input type="text" class="form-control form-control-flush" placeholder="Input placeholder" />
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Longer description</div>
<div class="datagrid-content">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</div>
</div>
</div>Horizontal
Add the .datagrid-horizontal class to put the label beside the value. Each pair takes a full row, which is easy to scan when the values are long.
<div class="datagrid datagrid-horizontal">
<div class="datagrid-item">
<div class="datagrid-title">Plan</div>
<div class="datagrid-content">Business</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Status</div>
<div class="datagrid-content">
<span class="status status-green">Active</span>
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Address</div>
<div class="datagrid-content">44 Harbor Street, Portland, OR 97209, United States</div>
</div>
</div>Set --tblr-datagrid-title-width to change the width of the label column. Add a .datagrid-cols-{n} class to show several pairs in a row.
<div class="datagrid datagrid-horizontal datagrid-cols-2" style="--tblr-datagrid-title-width: 5rem">
<div class="datagrid-item">
<div class="datagrid-title">CPU</div>
<div class="datagrid-content">8 cores</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Memory</div>
<div class="datagrid-content">32 GB</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Storage</div>
<div class="datagrid-content">512 GB</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Region</div>
<div class="datagrid-content">eu-central</div>
</div>
</div>Column width
Columns are generated with auto-fit, so the item width decides how many fit in a row. Set the custom properties on the .datagrid element to change the layout:
| Variable | Description | Default |
|---|---|---|
--tblr-datagrid-item-width |
Minimum width of a column | 15rem |
--tblr-datagrid-padding |
Gap between the items | 1.5rem |
--tblr-datagrid-title-width |
Label column in a horizontal datagrid | 10rem |
Use a lower item width for short values, such as numbers or single words. More columns then fit in a row.
<div class="datagrid" style="--tblr-datagrid-item-width: 7rem">
<div class="datagrid-item">
<div class="datagrid-title">CPU</div>
<div class="datagrid-content">8 cores</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Memory</div>
<div class="datagrid-content">32 GB</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Storage</div>
<div class="datagrid-content">512 GB</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Region</div>
<div class="datagrid-content">eu-central</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Uptime</div>
<div class="datagrid-content">99.98%</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Backups</div>
<div class="datagrid-content">Daily</div>
</div>
</div>Fixed number of columns
Add a .datagrid-cols-{n} class to keep the same number of columns at any container width. The classes go from .datagrid-cols-1 to .datagrid-cols-4. The item width is ignored then.
<div class="datagrid datagrid-cols-2">
<div class="datagrid-item">
<div class="datagrid-title">Order</div>
<div class="datagrid-content">#48213</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Status</div>
<div class="datagrid-content">
<span class="badge bg-green-lt">Paid</span>
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Placed</div>
<div class="datagrid-content">September 12, 2026</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Total</div>
<div class="datagrid-content">
<strong>$248.00</strong>
</div>
</div>
</div>A single column works well in a narrow sidebar or an offcanvas.
<div class="datagrid datagrid-cols-1">
<div class="datagrid-item">
<div class="datagrid-title">Email</div>
<div class="datagrid-content">
<a href="#">
<a href="mailto:[email protected]">[email protected]</a>
</a>
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Shipping address</div>
<div class="datagrid-content">44 Harbor Street, Portland, OR 97209, United States</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Notes</div>
<div class="datagrid-content text-secondary">Not set</div>
</div>
</div>Gap
Lower --tblr-datagrid-padding to make a dense datagrid. The same value is used between columns and between rows.
<div class="datagrid" style="--tblr-datagrid-item-width: 7rem; --tblr-datagrid-padding: 0.75rem">
<div class="datagrid-item">
<div class="datagrid-title">CPU</div>
<div class="datagrid-content">8 cores</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Memory</div>
<div class="datagrid-content">32 GB</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Storage</div>
<div class="datagrid-content">512 GB</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Region</div>
<div class="datagrid-content">eu-central</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Uptime</div>
<div class="datagrid-content">99.98%</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Backups</div>
<div class="datagrid-content">Daily</div>
</div>
</div>Examples
Inside a card
A datagrid has no border or background of its own. Put it in a card to build a detail panel. The card header holds the title and the footer holds the actions.
<div class="card">
<div class="card-header">
<h3 class="card-title">Domain details</h3>
<div class="card-actions">
<a href="#" class="btn btn-sm">
<!-- Download SVG icon from http://tabler.io/icons/icon/pencil -->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="icon">
<path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" />
<path d="M13.5 6.5l4 4" />
</svg> Edit
</a>
</div>
</div>
<div class="card-body">
<div class="datagrid" style="--tblr-datagrid-item-width: 12rem">
<div class="datagrid-item">
<div class="datagrid-title">Domain</div>
<div class="datagrid-content">
<a href="#">tabler.io</a>
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Registrar</div>
<div class="datagrid-content">Third Party</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">SSL certificate</div>
<div class="datagrid-content">
<!-- Download SVG icon from http://tabler.io/icons/icon/lock -->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="icon text-green icon-inline">
<path d="M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6" />
<path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0" />
<path d="M8 11v-4a4 4 0 1 1 8 0v4" />
</svg> Valid until May 2, 2027
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Expiration date</div>
<div class="datagrid-content">–</div>
</div>
</div>
</div>
<div class="card-footer text-end">
<button type="button" class="btn btn-primary">Renew domain</button>
</div>
</div>Statuses and progress
Show the state of a resource with a status, a badge or a progress bar.
<div class="datagrid">
<div class="datagrid-item">
<div class="datagrid-title">State</div>
<div class="datagrid-content">
<span class="status status-green">Running</span>
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Environment</div>
<div class="datagrid-content">
<span class="badge bg-blue-lt">Production</span>
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Disk usage</div>
<div class="datagrid-content">
<div class="mb-1">68%</div>
<div class="progress progress-sm">
<div class="progress-bar" style="width: 68%" role="progressbar" aria-valuenow="68" aria-valuemin="0" aria-valuemax="100" aria-label="68% used"></div>
</div>
</div>
</div>
</div>Values to copy
Add a clipboard button next to a value that users copy, such as an API key. Point data-bs-target at the element with the value and give the button an aria-label that names it.
tblr_live_8f3a2c91d7e4<div class="datagrid datagrid-cols-1">
<div class="datagrid-item">
<div class="datagrid-title">Client ID</div>
<div class="datagrid-content d-flex align-items-center gap-2">
<code id="datagrid-client-id">tblr_live_8f3a2c91d7e4</code>
<button type="button" class="btn btn-sm btn-icon btn-action" data-bs-toggle="clipboard" data-bs-target="#datagrid-client-id" aria-label="Copy the client ID">
<!-- Download SVG icon from http://tabler.io/icons/icon/clipboard -->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="icon clipboard-label">
<path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" />
<path d="M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2" />
</svg>
<!-- Download SVG icon from http://tabler.io/icons/icon/check -->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="icon clipboard-feedback text-green">
<path d="M5 12l5 5l10 -10" />
</svg>
<span class="clipboard-feedback visually-hidden">Copied</span>
</button>
</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">Webhook URL</div>
<div class="datagrid-content d-flex align-items-center gap-2">
<code id="datagrid-webhook-url">
<a href="https://example.com/hooks/tabler">https://example.com/hooks/tabler</a>
</code>
<button type="button" class="btn btn-sm btn-icon btn-action" data-bs-toggle="clipboard" data-bs-target="#datagrid-webhook-url" aria-label="Copy the webhook URL">
<!-- Download SVG icon from http://tabler.io/icons/icon/clipboard -->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="icon clipboard-label">
<path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2" />
<path d="M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2" />
</svg>
<!-- Download SVG icon from http://tabler.io/icons/icon/check -->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="icon clipboard-feedback text-green">
<path d="M5 12l5 5l10 -10" />
</svg>
<span class="clipboard-feedback visually-hidden">Copied</span>
</button>
</div>
</div>
</div>Accessibility
The pairs are only visually connected, so tell assistive tech how they belong together.
- A screen reader reads a
divbased datagrid as loose lines of text. When the pairs matter, use a description list instead:dl.datagrid, thendiv.datagrid-itemwrapping adt.datagrid-titleand add.datagrid-content. The styles are class based, so nothing changes visually. - Keep the label short and meaningful on its own. "Expiration date" works out of context, "Date" does not.
- When a value is empty, write it out - a dash or "Not set" - instead of leaving the cell blank.
- A value that is a form control still needs its own label. Use the
.datagrid-titleas that label by pairingforandid, or add anaria-labelto the control.
- Registrar
- Third Party
- Expiration date
- –
<dl class="datagrid">
<div class="datagrid-item">
<dt class="datagrid-title">Registrar</dt>
<dd class="datagrid-content">Third Party</dd>
</div>
<div class="datagrid-item">
<dt class="datagrid-title">Expiration date</dt>
<dd class="datagrid-content">–</dd>
</div>
</dl>Class reference
Every class this component ships, grouped by what it changes. A name in braces stands for a family — {color} is any base color, {breakpoint} any responsive step.
datagrid | component | Container element, a responsive grid of label and value pairs |
datagrid-item | part | One label and value pair |
datagrid-title | part | Label of a value, styled as a subheader |
datagrid-content | part | Value of the pair, with the margin reset so a dd fits |
datagrid-cols-{n} | modifier | Fixed number of columns, from 1 to 4 |
datagrid-horizontal | direction | Puts the label beside the value and shows one pair per row |
CSS
Variables
The component uses local CSS variables for real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.
On .datagrid. Source: core/scss/ui/_datagrid.scss.
--datagrid-padding: #{$datagrid-padding};
--datagrid-item-width: #{$datagrid-item-width};
--datagrid-title-margin-bottom: #{$datagrid-title-margin-bottom};
--datagrid-title-width: #{$datagrid-title-width};Sass variables
Override these variables before importing Tabler to change the defaults.
Source: core/scss/_variables.scss.
$datagrid-padding: 1.5rem;
$datagrid-item-width: 15rem;
$datagrid-title-margin-bottom: 0.25rem;
$datagrid-title-width: 10rem;
$datagrid-columns: 4;
