add-component-property

Adds a reactive property to an existing Lit web component with decorators and tests.

169|10|Updated May 12, 2021
One-click install
npx skills add https://github.com/IgniteUI/igniteui-webcomponents --skill add-component-property
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-component-property
Source: https://github.com/IgniteUI/igniteui-webcomponents/tree/main/.github/skills/add-component-property
Command: npx skills add https://github.com/IgniteUI/igniteui-webcomponents --skill add-component-property

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you extend existing Lit web components by adding a new reactive property with proper decorators, types, tests, and documentation, ensuring consistent API design and maintainable component code.

Core Features & Use Cases

  • Add a new property with @property decorator and correct type and reflection rules
  • Update render and state wiring when the property affects UI
  • Update tests and Storybook stories to reflect new property

Quick Start

Add a new reactive property to an existing Lit component and update tests and stories accordingly

Frequently Asked Questions about add-component-property

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a reactive property to an existing Lit web component?

To add a reactive property to a Lit web component, you apply the @property decorator with correct type annotations and optional attribute reflection. This skill updates the render, state wiring, tests, and Storybook stories to reflect the new property.

What is the best way to extend a Lit component API with new attributes?

Extending a Lit component API involves adding a new reactive property using the @property decorator. This approach ensures proper type annotations and attribute reflection while consistently updating UI rendering and component documentation.

Do I need to update Storybook stories when adding a new Lit property?

Yes, you need to update Storybook stories when adding a new Lit property. Updating stories and tests ensures the new reactive attribute is properly documented, visualized, and verified within the component's API.

Can I configure attribute reflection when adding a reactive property in Lit?

Yes, you can configure optional attribute reflection when adding a reactive property in Lit. The @property decorator allows you to define type annotations and reflection rules to ensure the web component API behaves correctly.

Why does adding a new property to my Lit component require updating tests?

Adding a new property to a Lit component requires updating tests to verify the new reactive behavior and attribute reflection. This ensures the updated render logic and state wiring maintain consistent component code and API stability.

When should I use the @property decorator in Lit web components?

You should use the @property decorator in Lit web components when you need to add a reactive property that affects UI rendering or state. It ensures proper type annotations and attribute reflection for maintaining consistent component APIs.