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.
In this repository51 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agentic-workflowsSkill
- asking-questionsSkill
- branch-context-consumerSkill
- broSkill
- browser-accessSkill
- browser-controlSkill
- changeset-scopeSkill
- check-skill-updatesSkill
- chillSkill
- cleanup-unnecessary-variablesSkill
- code-reviewSkill
- decision-modelsSkill
- diagnoseSkill
- effect-principlesSkill
- evidence-firstSkill
- gh-stackSkill
- git-contextSkill
- github-development-rulesetsSkill
- github-repository-setupSkill
- grillingSkill
- handoffSkill
- herdr-workflowsSkill
- home-assistant-frontendSkill
- home-assistant-lazy-contextSkill
- home-assistant-lit-renderingSkill
- human-step-guideSkill
- import-external-skillSkill
- lit-renderingSkill
- maintain-docsSkill
- opencode-effectSkill
- pitchfork-dev-serversSkill
- pkexec-rootSkill
- planSkill
- release-oxlint-rulesSkill
- remove-single-use-functionsSkill
- researchSkill
- retroSkill
- safe-process-signalsSkill
- session-coordinationSkill
- shared-workflowsSkill
- show-meSkill
- skill-prefixesSkill
- staged-implementationSkill
- task-focusSkill
- testingSkill
- to-questionnaireSkill
- types-enforce-tsSkill
- wranglerSkill
- writing-dot-skillsSkill
- writing-styleSkill
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
- Very specific: line 10
Use this skill when working with list containers or list items in the Home Assistant frontend.
- Very specific: line 72
All items expose: base, start, content, headline, supporting-text, end.
- Very specific: line 98
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 …
- Very specific: line 114
Do not use ha-list-item-button for non-interactive display rows — use ha-list-item-base.
- Very specific: line 115
Do not put ha-list-item-option inside ha-list-nav — use ha-list-selectable.
- Very specific: line 116
Do not handle selection in individual items — ha-list-selectable owns selection state.
- Very specific: line 117
Do not use @click on ha-list-item-option for selection — listen to ha-list-selected on the container.
- Very specific: line 118
Do not add role attributes manually — the components set correct ARIA roles automatically.
≈ “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.
Files
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 case | Container | Items |
| Navigation list (links) | ha-list-nav | ha-list-item-button with href |
| Action list (buttons) | ha-list-base | ha-list-item-button without href |
| Single-select listbox | ha-list-selectable | ha-list-item-option |
| Multi-select listbox | ha-list-selectable multi | ha-list-item-option |
| Static display rows | ha-list-base | ha-list-item-base |
Slot Mapping (MWC to New)
| Old (MWC) | New | Notes |
| default slot (text) | headline slot or .headline attribute | Primary text |
slot="secondary" | supporting-text slot or .supportingText attribute | Secondary 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 (default0)--ha-list-padding— padding around the list (default0)
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 (default48px)
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:rippleha-list-item-option:ripple,checkbox
Events
ha-list-activated— fromha-list-baseon Enter/Space. Detail:{ index, item }.ha-list-selected— fromha-list-selectableon selection change. Detail:{ index, diff: { added, removed } }.
Migration Rules
From ha-list + ha-list-item (MWC)
- Identify interactivity: Does the item navigate (href), perform an action (click), allow selection, or just display info?
- Pick container: Navigation →
ha-list-nav. Selection →ha-list-selectable. Otherwise →ha-list-base. - Pick item: Navigates →
ha-list-item-buttonwithhref. Action →ha-list-item-buttonwithouthref. Selection →ha-list-item-option. Static →ha-list-item-base. - Remap slots:
graphic→start,meta→end, text →headline/supporting-text. - Remove MWC attributes:
twoline,hasMeta,hasGraphic,noninteractive,activated,graphic="icon"— these have no equivalent and are not needed. - Replace event listeners:
@request-selected→ useha-list-selectedon the container (for selectable) or@click/ha-list-activatedfor 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 documentationAnti-patterns
- Do not use
ha-list-item-buttonfor non-interactive display rows — useha-list-item-base. - Do not put
ha-list-item-optioninsideha-list-nav— useha-list-selectable. - Do not handle selection in individual items —
ha-list-selectableowns selection state. - Do not use
@clickonha-list-item-optionfor selection — listen toha-list-selectedon the container. - Do not add
roleattributes manually — the components set correct ARIA roles automatically.
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
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.

