Lit components
Use Lit's standard decorators with TypeScript auto-accessors.
- Import decorators from their individual
lit/decorators/<name>.jsmodules. - Declare public reactive inputs with
@property(...) public accessorand internal render state with@state() private accessor. - Initialize accessors inline when they have defaults. Use a definite-assignment assertion for required inputs supplied by the host.
- Use
{ attribute: false }for object or array inputs that must not map to HTML attributes. Specifytypewhen an attribute needs Lit conversion. - Do not use the legacy
static propertiesplusdeclarepattern for reactive members, or enableexperimentalDecorators/legacy class-field semantics. - Verify the component with its package compile, lint, unit tests, and focused browser tests when behavior or rendering changes.