agentleFS
timmo001timmo001/skills/home-assistant-list-components/SKILL.md

home-assistant-list-components

Skill1 starsChanged 56 days agoApache-2.0View on GitHub

Home Assistant list component migration and usage guidance. Use when editing ha-list, ha-list-item, ha-md-list, or migrating to ha-list-nav, ha-list-selectable, ha-list-item-button, ha-list-item-option, or ha-list-item-base.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 0 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when working with list containers or list items in the Home Assistant frontend.

    line 10
  2. Very specific:

    All items expose: base, start, content, headline, supporting-text, end.

    line 72
  3. Very specific:

    Use ha-list-item-base (not ha-list-item-button) for rows that display info without a link or action but still need to live inside a nav …

    line 98
  4. Very specific:

    Do not use ha-list-item-button for non-interactive display rows — use ha-list-item-base.

    line 114
  5. Very specific:

    Do not put ha-list-item-option inside ha-list-nav — use ha-list-selectable.

    line 115
  6. Very specific:

    Do not handle selection in individual items — ha-list-selectable owns selection state.

    line 116
  7. Very specific:

    Do not use @click on ha-list-item-option for selection — listen to ha-list-selected on the container.

    line 117
  8. Very specific:

    Do not add role attributes manually — the components set correct ARIA roles automatically.

    line 118

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Home Assistant List Components

Use this skill when working with list containers or list items in the Home Assistant frontend. The new primitives replace the deprecated MWC-based ha-list, ha-md-list, ha-list-item, and ha-md-list-item.

Component Hierarchy

ha-row-item (base row layout — slots, spacing, disabled)
├── ha-list-item-base (non-interactive, role="listitem")
│   ├── ha-list-item-button (interactive, renders <a> or <button>)
│   └── ha-list-item-option (selectable, role="option", aria-selected)

ha-list-base (roving-tabindex container, role="list")
├── ha-list-nav (wraps in <nav> landmark, use with ha-list-item-button + href)
└── ha-list-selectable (role="listbox", owns selection state)

Container Selection

Use caseContainerItems
Navigation list (links)ha-list-navha-list-item-button with href
Action list (buttons)ha-list-baseha-list-item-button without href
Single-select listboxha-list-selectableha-list-item-option
Multi-select listboxha-list-selectable multiha-list-item-option
Static display rowsha-list-baseha-list-item-base

Slot Mapping (MWC to New)

Old (MWC)NewNotes
default slot (text)headline slot or .headline attributePrimary text
slot="secondary"supporting-text slot or .supportingText attributeSecondary line
slot="graphic"slot="start"Leading icon/avatar
slot="meta"slot="end"Trailing content
—slot="content"Escape hatch: replaces entire middle column

CSS Custom Properties

Container

  • --ha-list-gap — spacing between items (default 0)
  • --ha-list-padding — padding around the list (default 0)

Row

  • --ha-row-item-padding-block — vertical padding
  • --ha-row-item-padding-inline — horizontal padding
  • --ha-row-item-gap — gap between start/content/end
  • --ha-row-item-min-height — minimum row height (default 48px)

Focus

  • --ha-list-item-focus-radius — focus outline border-radius
  • --ha-list-item-focus-width — focus outline width (steady state)
  • --ha-list-item-focus-offset — focus outline offset
  • --ha-list-item-focus-background — background color on keyboard focus

Selection

  • --ha-list-item-selected-background — background when selected (appearance="line")

CSS Parts

All items expose: base, start, content, headline, supporting-text, end.

Additional parts:

  • ha-list-nav: nav (the <nav> wrapper), base (inner div)
  • ha-list-item-button: ripple
  • ha-list-item-option: ripple, checkbox

Events

  • ha-list-activated — from ha-list-base on Enter/Space. Detail: { index, item }.
  • ha-list-selected — from ha-list-selectable on selection change. Detail: { index, diff: { added, removed } }.

Migration Rules

From ha-list + ha-list-item (MWC)

  1. Identify interactivity: Does the item navigate (href), perform an action (click), allow selection, or just display info?
  2. Pick container: Navigation → ha-list-nav. Selection → ha-list-selectable. Otherwise → ha-list-base.
  3. Pick item: Navigates → ha-list-item-button with href. Action → ha-list-item-button without href. Selection → ha-list-item-option. Static → ha-list-item-base.
  4. Remap slots: graphic → start, meta → end, text → headline/supporting-text.
  5. Remove MWC attributes: twoline, hasMeta, hasGraphic, noninteractive, activated, graphic="icon" — these have no equivalent and are not needed.
  6. Replace event listeners: @request-selected → use ha-list-selected on the container (for selectable) or @click / ha-list-activated for buttons.

Non-interactive rows inside ha-list-nav

Use ha-list-item-base (not ha-list-item-button) for rows that display info without a link or action but still need to live inside a nav list. These participate in the list layout but are excluded from roving tabindex.

Tooltip on non-interactive rows

ha-list-item-base accepts pointer events by default, so ha-tooltip hover works without needing interactive.

Reference Implementations

src/panels/config/components/ha-config-navigation-list.ts  — ha-list-nav + ha-list-item-button
src/panels/config/devices/ha-config-device-page.ts         — mixed ha-list-item-button + ha-list-item-base in ha-list-nav
gallery/src/pages/components/ha-list.markdown              — canonical gallery documentation

Anti-patterns

  • Do not use ha-list-item-button for non-interactive display rows — use ha-list-item-base.
  • Do not put ha-list-item-option inside ha-list-nav — use ha-list-selectable.
  • Do not handle selection in individual items — ha-list-selectable owns selection state.
  • Do not use @click on ha-list-item-option for selection — listen to ha-list-selected on the container.
  • Do not add role attributes manually — the components set correct ARIA roles automatically.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.