Skip to content

Sizing in sections ​

Every card tells Home Assistant's sections view how large it wants to be, so it lands with a sensible size. This guide explains the grid, each card's default size, and how cards fill the height they are given.

The grid ​

A section is 12 columns wide and made of rows of 56 px, with 8 px gaps. grid_options sets a card's size: columns (6 is half a section, full the whole width) and rows. The dashboard editor's layout tab and the grid handles write the same keys.

rows: auto makes a card as tall as its content. Most cards use it by default; a number pins the height:

yaml
type: custom:tile-group-card-pro
title: Rooms
tiles: [light.living_room, light.desk_lamp, climate.living_room]
grid_options: { columns: 12, rows: 4 }

Every card also takes visibility, layout_options (the old spelling of grid_options), view_layout, card_mod and uix; Home Assistant (card-mod or UIX for those two) applies them, not the card.

Default sizes ​

Each card's least size (min_columns, min_rows) keeps the grid handles from making it unreadable. grid_options can override any of them.

CardDefaultLeast
Tile6 columns, auto3 columns, 1 row; 4 with a switch or hold button on the line, 6 with a wider control
Tile with a plot6 columns, auto2 rows
Vertical tileits least, auto3 columns (6 with a wide control), 2 rows; a row more each for a control, a plot, badges
Poster6 columns, 3 rows6 columns, 3 rows
Tile group6 columns, auto6 columns; layout: row defaults to 12
Heading cardfull width, auto3 columns
Layout and swipe cardfull width, auto–
Weather card6 columns, auto3 columns, 1 row (2 with a header)
Weather card, sections12 columns, auto6 columns, 2 rows
Sun path card12 columns, auto6 columns
Sun azimuth card12 columns, auto6 columns
Multi trend card12 columns, auto6 columns, 2 rows
Power and energy flow12 columns, auto6 columns, 3 rows

Sizes shows the tile's and the poster's sizes in detail.

Spanned sections ​

A section with column_span: 2 or 3 has 12 columns per visible column, and the count shrinks with the screen: 36 on a wide desktop, 24 in a narrower window, 12 on a phone.

Pick widths that divide 12, 24 and 36, so rows stay full on every screen. columns: 12 gives one card per row on a phone, two in a narrower window, three on a desktop; columns: 6 gives two, four and six. columns: 9 looks right on a phone but leaves gaps on a desktop.

Filling the height ​

As Home Assistant's own cards do, every card takes the height it is given: its cell's with a number of rows, and with rows: auto its grid row's, so cards side by side are as tall as the tallest of them. A horizontal stack works the same way. The part of a card that can stretch fills that height, so the card lines up with its neighbours:

CardWhat fills the height
Tilethe plot below the line; any other tile centres its content
Posterthe visual behind; the content stays at the bottom
Weather cardits trends and plots; without sections it centres its content
Multi trend cardthe plot
Sun path cardthe plot
Sun azimuth cardthe picture, centred
Power and energy flowthe tree: spread out when taller, scaled down when smaller
Edit

Keeping a card's own height ​

fill_height: false keeps a card at its own height in a taller row or a horizontal stack, with the room left under it: a short room beside a longer one, for example. A cell smaller than the card cuts it off at the bottom.

Edit

Inside other cards ​

The least sizes bind only the sections grid. A layout card, a swipe card or a stack may give a card less room, and the card fits into it as well as it can. In a layout card, a card's view_layout sets its span and place.

Masonry and panel views ​

The cards work in the older views too. In a masonry view each card reports its height so Home Assistant can balance the columns; there is nothing to set, and grid_options does nothing there. Wherever the height follows the content, as in masonry or a vertical stack, every card keeps its own height. In a panel view the one card takes the whole view.

The examples here ​

The examples on this site are drawn at the width of one section (400 px). A card with columns: 6 takes half of that, as it would on your dashboard.

Released under the MIT License.