Skip to content

Developer Guide

Documentation for developers extending LCARdS — building custom cards, editors, and packs.

How-to Guides

PageDescription
Building a Custom CardExtend LCARdSCard, wire lifecycle hooks, register in lcards.js
Building an EditorAdd a visual editor to your card using LCARdSBaseEditor
Building a PackBundle style presets, components, themes, audio, and more into a distributable pack

API Reference

PageDescription
Animation APIwindow.lcards.anim.* — anime.js v4 access, helpers, presets, scopes
Assets & SVG APIFont loading, SVG cache, SVG/anchor helpers, text measure cache
Color ResolutionCorrect patterns for resolving CSS vars, computed expressions (darken, lighten, alpha, etc.) in all contexts
Debug APIConsole introspection: log level, core singletons, MSD cards, data sources
Helpers APIWebSocket-based HA helper management — create, read, update, delete

Internals

PageDescription
Codebase ReviewArchitecture findings, duplication hotspots, and prioritized follow-up PR slices

Repository validation commands

These run in CI and are safe to run locally before opening a PR:

CommandWhat it does
npm run validate:css-varsAudits every --lcars-*, --lcards-*, and theme: reference against the allowlists in scripts/ha-lcars-theme-vars.js and src/lcards-vars.js. Gates npm run build.
npm run validate:doc-examplesParses every fenced yaml/yml block in doc/**.md, checks that any type: custom:lcards-* value matches a registered element, and validates parsed card configs against the real JSON Schemas from src/cards/schemas/ (7 card types covered; lcards-msd-card excluded). Add --strict to promote schema and parse warnings to errors. Two fence meta hints: ```yaml alternatives skips YAML parsing but still checks type refs; ```yaml no-validate skips the block entirely.
npm run typecheckRuns tsc against the JSDoc-typed sources.
npm run docs:buildBuilds the VitePress site.