custom-element

Define typed Web Components with reactive attributes, events, and lifecycle behavior.

6|1|Updated May 31, 2026
One-click install
npx skills add https://github.com/yw662/rikka --skill custom-element
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: custom-element
Source: https://github.com/yw662/rikka/tree/main/skills/custom-element
Command: npx skills add https://github.com/yw662/rikka --skill custom-element

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create real Web Components with TypeScript-safe attributes, events, methods, and lifecycle behavior without decorators or manual registration boilerplate.

Core Features & Use Cases

  • Reactive Attributes: Define typed HTML attributes that stay synchronized with element state and re-render automatically.
  • Custom Events: Declare event transforms, dispatch helpers, and handler properties for clean component communication.
  • Typed Builder Workflow: Use the phased builder API when you need strict this typing across methods, render logic, and templates.
  • Use Case: Build a reusable counter, form control, or dashboard widget that exposes a stable custom tag, supports Shadow DOM styling, and works seamlessly in rikka-dom.

Quick Start

Ask for a rikka custom element with typed attributes, a render function, and a custom event so you can implement the component directly.

Frequently Asked Questions about custom-element

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

FAQPage Schema
How do I build typed Web Components with reactive attributes in TypeScript?

You build typed Web Components with reactive attributes by defining typed HTML attributes that synchronize with element state and trigger automatic re-renders. This approach eliminates manual registration boilerplate and ensures type safety across the component lifecycle.

What is the best way to create custom elements with Shadow DOM templates without decorators?

Creating custom elements with Shadow DOM templates without decorators involves using a phased builder API to wire templates and configure shadow settings. This method provides strict typing across render logic and templates while avoiding decorator complexity.

How do custom events work when dispatching state changes in Web Components?

Custom events for dispatching state changes work by declaring event transforms, dispatch helpers, and handler properties. This setup ensures clean component communication by exposing structured event dispatchers that integrate seamlessly with the DOM composition.

Can I expose custom element helpers for TypeScript and DOM composition?

Yes, you can expose custom element helpers for TypeScript and DOM composition by utilizing a strict builder workflow. This workflow supports attribute and dataset signals, ensuring the custom tag operates reliably within rikka-dom environments.

Does this custom element approach support lifecycle behavior and dataset signals?

Yes, the custom element approach supports lifecycle behavior and dataset signals by applying attribute and dataset signals alongside custom event dispatchers. This ensures components react predictably to state changes throughout their lifecycle.

Why use a typed builder workflow for authoring custom tags?

Using a typed builder workflow for authoring custom tags ensures strict this typing across methods, render functions, and templates. This prevents type errors during component construction and maintains consistent reactive state management.