Data Grid Card
custom:lcards-data-grid

A grid of cells in the LCARS style: columns of generated numbers that fill a panel with texture, or a table of your own text, entity states and templates.
- Decorative: columns of generated digits, decimals, letters or hex codes, often with the classic LCARS colour cascade rolling down the rows. No entities needed.
- Data: a table you write row by row, where each cell is text, a live entity state, a template or a data source value.
Try it
- In the card editor, Open Configuration Studio gives you a live preview, a spreadsheet of your cells, and row, column and cell styling.
- The Playground lets you edit data grid YAML here in the docs and see the result.
The grids on these pages are live previews drawn with the card's own code. Entities show sample values.
| Page | Covers |
|---|---|
| Data and Cells | Decorative values, rows, what a cell can be, data sources, header rows, conditional colours, tap actions |
| Styling and Animation | Style layers and keys, header style, grid layout, the cascade, highlighting changes, filters |
| Playground | Edit YAML and see the grid live |
| Upgrading | Older data grid configs and what they become |
Quick start
Two grids to start from: the decorative grid the card picker adds, and a small status table.
- The first is six rows of mixed values with the colour cascade, as the card picker adds it.
- In the status table the first row is a header, the middle column shows each entity's state and the last column is a template.
yaml
type: custom:lcards-data-grid
data_mode: decorative
format: mixed
grid:
grid-template-rows: repeat(6, auto)
grid-template-columns: repeat(6, minmax(60px, 1fr))
gap: 0px
style:
padding: 0px
font_size: 22px
animations:
- trigger: on_load
preset: cascade-coloryaml
type: custom:lcards-data-grid
data_mode: data
rows:
- values: [System, Value, Status]
header: true
- [Inside, sensor.living_room_temperature, "{{ 'WARM' if states('sensor.living_room_temperature') | float > 22 else 'OK' }}"]
- [Outside, sensor.outdoor_temperature, "{{ 'WARM' if states('sensor.outdoor_temperature') | float > 22 else 'OK' }}"]
- [Humidity, sensor.living_room_humidity, "{{ states('sensor.living_room_humidity') | int }}%"]
grid:
grid-template-columns: 140px 1fr 90px
gap: 4px
style:
font_size: 18px
columns:
- style:
align: left
color: var(--lcars-orange)Which mode should I use?
data_mode picks the mode: decorative for generated values, data for your own rows. When it is left out, a card with rows is a data grid and anything else is decorative.
| Decorative | Data | |
|---|---|---|
| Shows | Generated values: digits, decimals, letters or hex | Your rows: text, entity states, templates, data source values |
| Set up with | format, the grid size in grid | rows |
| Changes when | Every refresh_interval ms (optional) | An entity, template or data source changes |
| Good for | Filling space with LCARS texture, backgrounds behind other cards | Status panels, sensor tables, system readouts |
Card options
The data grid's own top-level keys. Each has its section on a topic page; this table links to it.
- The grid also takes the keys every LCARdS card takes (
height,width,grid_options,overflow,z_index,id,tags...): see Common card properties. - In a sections view the grid asks for the full width and 4 rows unless
grid_optionssays otherwise, and never fewer than 4 columns and 2 rows.
yaml
type: custom:lcards-data-grid
data_mode: decorative
format: hex
refresh_interval: 2000 # new values every 2 seconds
refresh_cells: 0.2 # a fifth of the cells each time
grid:
grid-template-rows: repeat(4, auto)
grid-template-columns: repeat(8, 1fr)
gap: 0px
style:
font_size: 20px
color: var(--lcars-orange)
highlight_changes: trueMore about the card options
- Masonry views: the card reports its height from a pixel
height, or else from the number of rows: each row 1.5 times the grid'sfont_size(24pxby default) plus the row gap (8pxby default), in units of 50 px. - In a short space: rows never shrink below one line. A row is at least 1.5 times
font_sizeplus the cell padding (4 px above and below by default), with the row gap between rows; rows that do not fit are clipped. Two 14 px rows need 66 px with the defaults, or 44 px withgrid.gap: 2pxandstyle.padding: 0. - Rules: the rules engine finds the grid by
idandtags. A rule'sstylepatch applies to the grid-widestyle. - Older keys: a config with keys from earlier versions still works; see Upgrading.
| Key | Type | Default | Description |
|---|---|---|---|
data_mode | string | data with rows, else decorative | decorative or data: see Which mode should I use? |
format | string | mixed | Decorative mode: the kind of value generated. See Decorative mode |
refresh_interval | number | 0 | Decorative mode: new values every this many ms. 0 keeps them fixed |
refresh_cells | number | 1 | Decorative mode: the share of cells that change on each refresh, 0 to 1 |
rows | list | - | Data mode: the rows of cells. See rows |
cell_tap_action | action | - | What tapping an entity cell does: see Tap actions |
data_sources | object | - | Named data sources for {datasource:...} cells: see Data sources |
triggers_update | list | - | Extra entity ids whose changes re-run the templates, for JavaScript templates: see Manual tracking |
grid | object | equal columns, 8px gap | CSS Grid layout: see Grid layout |
style | object | theme defaults | Style for every cell: see Style keys |
header_style | object | header defaults | Style for header rows: see Header rows |
columns | list | - | Per column, by position: style, and format in decorative mode. See Style layers |
animations | list | - | Card animations, including the cascade-color preset: see The cascade |
highlight_changes | boolean / object | off | Animate cells whose value just changed: see Highlighting changes |
filters | list | - | CSS filters on the whole grid: see Filters |