The Home Assistant sections view, explained with a working layout
The sections view arrived in Home Assistant 2024.8 and is now the default way to build a dashboard. It is easier to keep tidy than the older masonry view, but the YAML is not obvious the first time. This guide shows the structure, what each key does, and a working three-section layout.
Disclosure: Written by the maker of this site. The YAML below parses as valid YAML and uses only built-in Home Assistant cards and options from the official documentation. This exact example has not been run on every Home Assistant version or setup.
The structure in one minute
A dashboard has views. A view with type: sections has a list called sections. Each section is a column-like block, and in the YAML it is usually a grid that holds a list of cards. On a wide screen, sections sit side by side up to the view's max_columns. On a narrow screen they stack.
That is the whole idea. The practical consequence is that you think in groups: lights in one section, climate in another, security in a third. You do not position cards by pixel, and you do not fight the old masonry algorithm that moved cards around depending on height.
Keys worth knowing
max_columns: the most sections shown side by side. Use 3 for a typical desktop, 4 for a wall tablet, 1 for a phone.type: headingcard: a built-in title line you can drop at the top of any section. Use itsheadingoption for the text,iconfor an icon andbadgesfor small live readings.- A nested
gridcard withcolumnsandsquare: false: gives you a row of two or three cards inside a section, with natural height. path: the URL slug of the view. Navigate actions use it for links, such as/lovelace/security.
The visual editor also lets you drag cards between sections, and writes this same YAML for you. Switching to the raw editor is useful to copy a section between dashboards or to make the same change in six places at once.
The YAML
Complete example. Paste it into the raw configuration editor of a dashboard, then replace the placeholder entity ids with yours.
title: Sections demo
views:
- title: Home
path: home
icon: mdi:home
type: sections
max_columns: 3
sections:
- type: grid
cards:
- type: heading
heading: Lights
- type: tile
entity: light.living_room
- type: tile
entity: light.kitchen
- type: tile
entity: light.bedroom
- type: grid
cards:
- type: heading
heading: Climate
- type: gauge
entity: sensor.living_room_temperature
name: Living room
min: 10
max: 35
severity:
green: 10
yellow: 28
red: 33
- type: tile
entity: climate.thermostat
- type: grid
cards:
- type: heading
heading: Security
- type: heading
heading: Entry
icon: mdi:shield-home
tap_action:
action: navigate
navigation_path: /lovelace/security
badges:
- type: entity
entity: lock.front_door
show_state: true
- type: entity
entity: binary_sensor.front_door
show_state: true
- type: logbook
title: Doors
hours_to_show: 24
target:
entity_id:
- binary_sensor.front_door
- binary_sensor.garage_door
- title: Security
path: security
icon: mdi:shield-home
type: sections
max_columns: 2
sections:
- type: grid
cards:
- type: heading
heading: Locks
- type: tile
entity: lock.front_door
- type: tile
entity: lock.back_door
How to extend it
To add a section, copy one of the three blocks and edit its cards. To add a card, insert it into a section's cards list. To add another view, add another item under views with its own path and link to it from a heading using a navigate tap action with navigation_path: /lovelace/your-path.
When a section gets too tall, split it. Two short sections look better than one tall one and they reflow better on tablets. As a rough rule, we keep a section to five or six cards at most.
Common mistakes
Indentation. YAML is strict. A card indented one space too few quietly becomes part of the wrong list. Paste into the raw editor and let Home Assistant's validation warn you.
Mixing view types. Fields from the older masonry view, such as cards directly under the view, do not belong in a sections view. Use sections and put cards inside them.
Typos in type. A misspelled card type shows an error card in that spot. Compare it with the card names in the official dashboard documentation.
Version. If the sections type is not recognized, check that you are on Home Assistant 2024.8 or newer.
Quick answers
Can I convert an old masonry dashboard to sections?
Home Assistant offers a way to change a view's type in the editor, but results vary, so keep a copy of your YAML first and check every card afterward.
Can sections be different widths?
Sections can span more than one column through their own settings in the visual editor. Look at the YAML after you change it to see which key was added.
How many cards fit in a section?
There is no hard limit. In practice five or six cards stay readable, and past that it is better to start a new section.