template-binding

Create declarative custom element templates with reactive text, attribute, and event bindings.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you write declarative custom element templates without manually composing every node in render logic, so you can keep markup readable while still getting reactive updates and typed events.

Core Features & Use Cases

  • Declarative HTML templates for defineElement components with text, attribute, and event bindings.
  • Reactive lookup for declared attributes, slots, and custom event dispatch from template markup.
  • Useful when building compact web components, form controls, cards, or other UI pieces that need stable structure and strong TypeScript inference.

Quick Start

Use this skill to turn a defineElement custom element into a template-driven component with {{name}} bindings and {{@event}} event dispatch.

Frequently Asked Questions about template-binding

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

FAQPage Schema
How do I bind reactive text and attributes in custom element templates?

Reactive text and attribute bindings in custom element templates are achieved by writing declarative HTML markup with {{name}} interpolation. This resolves declared attributes automatically, keeping your web components readable without programmatic render functions.

How do I dispatch custom events from an HTML template in web components?

Dispatching custom events from HTML template markup uses the {{@event}} binding syntax. You must provide matching event keys in your component's events configuration to trigger the custom event dispatch correctly from within the template.

Can I use programmatic render functions with declarative template bindings?

Declarative template bindings are designed to replace manual programmatic render functions by relying on HTMLTemplateElement markup and slots. This provides stable structure and strong TypeScript inference instead of manual node composition.

What is required to set up template binding for defineElement components?

Setting up template binding requires HTMLTemplateElement templates produced by an h function, declared attributes for {{name}} resolution, and matching events keys for {{@event}} dispatch within your defineElement components.

When should I use declarative template bindings instead of render functions?

Use declarative template bindings when building compact web components, form controls, or UI pieces that need stable structure. It keeps markup readable while delivering reactive updates and typed events without manually composing every node.