Skip to content

A utility package for dynamically loading Home Assistant UI components in custom cards and panels.

License

Notifications You must be signed in to change notification settings

KipK/load-ha-components

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Assistant Components Loader

A utility package for dynamically loading Home Assistant UI components in custom cards and panels.

Installation

npm install @kipk/load-ha-components

Usage

import { loadHaComponents, DEFAULT_HA_COMPONENTS } from '@kipk/load-ha-components';

// Use the default list of components
await loadHaComponents();

// Or specify your own list of components to load
await loadHaComponents([
  'ha-form',
  'ha-icon',
  'ha-selector'
]);

// Access the default components list
console.log(DEFAULT_HA_COMPONENTS);

How It Works

This utility uses Home Assistant's internal loading mechanism to dynamically load UI components that may not be loaded by default in custom cards or panels. It attempts to load components through:

  1. Home Assistant's panel resolver system
  2. A fallback event-based approach

Default Components

The following components are included in the default list:

  • ha-form
  • ha-icon
  • ha-icon-button
  • ha-selector
  • ha-textfield
  • ha-icon-picker
  • ha-entity-picker
  • ha-select
  • ha-dialog
  • ha-sortable
  • ha-svg-icon
  • ha-alert
  • mwc-button

License

MIT

About

A utility package for dynamically loading Home Assistant UI components in custom cards and panels.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •