Home assistant

Home Assistant Vertical Stack, Horizontal Stack and Grid Card Guide

On this page
    TL;DR: A Home Assistant vertical stack card puts several cards in one column, a horizontal stack card puts them side by side in one row, and a grid card lays them out in a set number of columns (3 by default, square by default). Add any of them with Edit dashboard, then Add card, then search for “Vertical stack”, “Horizontal stack” or “Grid”. In the modern sections view you need stacks less often, but they are still the best way to glue cards together.

    Updated November 2026 for Home Assistant 2026.10 and 2026.11, including the sections view that new dashboards use by default.

    The Home Assistant vertical stack card is one of the oldest layout tools on the dashboard, and it still matters. A dashboard is the screen where you see and control your devices, and a card is one box on that screen, like a light button or a temperature graph. Stack cards do not show anything by themselves. They hold other cards and keep them together.

    This guide explains the three layout cards (vertical stack, horizontal stack and grid), how to add them in the 2026 dashboard editor, when to pick each one, and the YAML behind them. YAML is the plain text format Home Assistant uses for settings. You can paste every example below into the card editor.

    The three layout cards at a glance

    • Vertical stack (type: vertical-stack): cards on top of each other in one column. People often search for it as the “vertical card”.
    • Horizontal stack (type: horizontal-stack): cards next to each other in one row. Every card gets an equal share of the width.
    • Grid (type: grid): cards in rows and columns. You choose how many columns, and when a row is full the next card starts a new row.

    All three can be nested. A vertical stack can contain a horizontal stack, a grid can contain a vertical stack, and so on. That is how you build a “block” such as a room panel with a title, a camera and a row of buttons.

    Popular with Home Assistant usersSONOFF ZBDongle-E (Zigbee 3.0 USB)Cheap, well supported Zigbee coordinator for ZHA or Zigbee2MQTT.Check price on AliExpressAqara Motion Sensor P1 (Zigbee)Fast, long battery life motion sensor for lighting automations.Check price on AliExpressShelly 1PM Gen3 relayGoes behind your existing wall switch, keeps it working, local API and power metering.Check price on AliExpress

    Sections view: where stacks fit in 2026

    A view is one page (one tab) of a dashboard. For a long time the standard view was masonry, which drops cards into columns automatically. Masonry decides where each card goes, so cards that belong together could end up far apart. Stack cards were the fix: wrap the cards in a stack and they always stay together.

    Today, new views use the sections layout, marked as the default in the view settings. A sections view is split into sections, and each section is its own small grid. You can drag and drop cards and whole sections, add a heading card on top of each section, and resize cards on the card’s Layout tab. The official sections view documentation describes sections as a way to group cards without stack cards.

    AliExpress deals

    So do you still need stacks? Often, yes:

    • Inside a section, cards still flow left to right and wrap. A stack keeps two or three cards locked together as one unit, so they move and resize together.
    • A horizontal stack forces cards into one row, even on a narrow phone screen.
    • If your dashboard still uses a masonry, panel or sidebar view, stacks are the main way to control layout.

    One limit to know: the Layout tab (the size picker) is not available for cards inside a vertical stack, horizontal stack or grid card. You can resize the stack itself in a section, but not the cards inside it.

    How to add a vertical stack card

    The steps are the same for all three layout cards. Only the name you search for changes.

    1. Open your dashboard and select the pencil (edit) icon in the top right. If this is the first time you edit this dashboard, Home Assistant asks you to take control. Open the three dots menu in that dialog and select Take control. From then on, the dashboard no longer adds new devices automatically, so you place them yourself.
    2. In a sections view, select the + (add card) button inside the section where you want the stack. In a masonry view, select Add card in the bottom right.
    3. Stay on the By card tab and type Vertical stack in the search box. Select it.
    4. Pick the first card that goes inside the stack, for example a Tile card, and set its entity. An entity is one thing Home Assistant can see or control, like light.kitchen.
    5. Select the small + next to the numbered tabs at the top of the editor to add a second card. Each card in the stack gets its own tab.
    6. Use the arrow icons next to the delete icon to move a card up or down (left or right in a horizontal stack). Select Save, then Done.

    Choosing the first card inside a Home Assistant vertical stack card

    The editor in the screenshots is from an older version, so colors and icons look a bit different today, but the numbered tabs and the + button work the same way.

    Adding another card to a stack with the plus button in the card editor

    If you prefer typing, select Show code editor at the bottom of the card editor and paste YAML instead. The examples in the next sections all work there.

    Vertical stack YAML example

    A simple room block: a heading, a light and the room temperature, always kept together in one column.

    type: vertical-stack
    cards:
      - type: heading
        heading: Living room
      - type: tile
        entity: light.living_room
      - type: tile
        entity: sensor.living_room_temperature

    The only required options are type and cards. You can also add title: to show a title above the stack, but the heading card looks cleaner on a 2026 dashboard.

    Horizontal stack YAML example

    Three buttons in one row. Each one gets a third of the width.

    type: horizontal-stack
    cards:
      - type: button
        entity: light.kitchen
        name: Kitchen
      - type: button
        entity: light.hallway
        name: Hallway
      - type: button
        entity: switch.coffee_machine
        name: Coffee

    Keep horizontal stacks short. Three or four small cards work well. Put six cards in one row and they get very narrow on a phone, because a horizontal stack never wraps to a second line.

    Grid card YAML example

    The grid card has two settings the stacks do not have: Columns and Render cards as squares. In YAML they are columns (default 3) and square (default true).

    type: grid
    columns: 3
    square: false
    cards:
      - type: tile
        entity: light.kitchen
      - type: tile
        entity: light.hallway
      - type: tile
        entity: light.bedroom
      - type: tile
        entity: cover.living_room_blinds
      - type: tile
        entity: lock.front_door

    With columns: 3, the first three cards fill row one and the fourth card starts row two. With square: true, every card is forced into a square shape, which looks tidy with button cards but squashes wide cards like graphs. Most people turn it off for tile cards.

    Grid card editor with the Columns and Render cards as squares options

    Grid vs horizontal stack vs vertical stack

    This is the comparison most people are looking for. The short version: use a vertical stack to keep a column together, a horizontal stack for one fixed row, and a grid when you have many similar cards.

    Card Layout Wraps to new rows? Extra options Best for
    Vertical stack One column Not needed title A room block: heading, controls, graph
    Horizontal stack One row, equal widths No title 2 to 4 buttons side by side
    Grid Rows and columns Yes, after the column count title, columns, square Many buttons or tiles of the same size

    A good rule of thumb: if you catch yourself putting horizontal stacks inside a vertical stack just to get two rows of buttons, a grid card does the same job with one card.

    Nesting stacks: a full room panel

    Here is a block that combines all three ideas. A vertical stack holds a heading, a camera picture, and a grid of light buttons.

    type: vertical-stack
    cards:
      - type: heading
        heading: Front of the house
      - type: picture-entity
        entity: camera.front_door
        show_name: false
      - type: grid
        columns: 2
        square: false
        cards:
          - type: tile
            entity: light.porch
          - type: tile
            entity: light.driveway
          - type: tile
            entity: lock.front_door
          - type: tile
            entity: binary_sensor.front_door

    Try not to nest more than two levels deep. Deep nesting makes the YAML hard to read and hard to edit later.

    Stacks inside a sections view (YAML)

    If you open the raw configuration editor of a sections view (three dots menu while editing), you will see that each section is written as type: grid. That is the section itself, not the grid card. It is a common source of confusion. A section with a stack inside looks like this:

    views:
      - title: Home
        type: sections
        sections:
          - type: grid
            cards:
              - type: heading
                heading: Kitchen
              - type: horizontal-stack
                cards:
                  - type: button
                    entity: light.kitchen
                  - type: button
                    entity: switch.kettle
                grid_options:
                  columns: full

    Each section is 12 columns wide. grid_options with columns: full makes the stack span the whole width of its section. You can set the same thing in the UI: open the stack, go to the Layout tab and turn on Full width.

    Tips and common problems

    • Cards look cramped in a horizontal stack. Use fewer cards, or switch to a grid card with 2 columns so they wrap.
    • Cards are oddly tall in a grid. Set square: false. Square mode is on by default.
    • I cannot resize a card inside a stack. That is expected. Resize the stack as a whole, or move the card out of the stack.
    • The stack has gaps between cards. Each inner card keeps its own border and spacing. Custom cards from HACS, the community store for extra cards, can merge them into one box if you really want that look.
    • My dashboard does not let me drag cards. Drag and drop only works in the sections view. Create a new view and pick the sections layout.

    Need something to put in your stacks? Our guides on building a toggle switch, a virtual switch, a dashboard clock and glance cards all produce cards that fit nicely inside a vertical stack or grid.

    Frequently Asked Questions

    What is the difference between a grid card and a horizontal stack in Home Assistant?

    A horizontal stack puts all its cards in a single row with equal widths and never wraps. A grid card uses a set number of columns (3 by default) and starts a new row when a row is full. Use a horizontal stack for 2 to 4 cards and a grid for more.

    Do I still need vertical stack cards with the sections view?

    Less often. Sections already group cards under a heading. A vertical stack is still useful when you want several cards to move and resize as one unit, or when your dashboard uses the older masonry view.

    How do I add a vertical stack card in Home Assistant?

    Edit your dashboard, select Add card (or the plus button in a section), search for Vertical stack on the By card tab, pick the first card, then use the plus next to the numbered tabs to add more cards. Save when done.

    Why are the cards in my grid card square?

    The grid card option Render cards as squares (square in YAML) is on by default. Turn it off in the editor or add square: false to the YAML and cards keep their normal height.

    1 comment

    Leave a comment

    Your email address will not be published. Required fields are marked *

    This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

    Coming soon
    The ready-made Home Assistant dashboard
    One email when it's ready, with an early-bird price. No spam. Privacy