svelte-template-directives

Apply Svelte 5.29+ template directives for reactive DOM manipulation.

Updated Mar 14, 2026
One-click install
npx skills add https://github.com/Andreicr1/netz-analysis-engine --skill svelte-template-directives
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: svelte-template-directives
Source: https://github.com/Andreicr1/netz-analysis-engine/tree/main/.gemini/skills/svelte-template-directives
Command: npx skills add https://github.com/Andreicr1/netz-analysis-engine --skill svelte-template-directives

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Svelte template directives like @attach, @html, and @render streamline reactive UI patterns, enabling clean, maintainable DOM updates and snippets.

Core Features & Use Cases

  • Reactive directive-based DOM manipulation and rendering for Svelte components.
  • Quick patterns for integrating third-party libraries, tooltips, and dynamic HTML using @attach and related directives.
  • Use Case: Build interactive widgets with minimal boilerplate by applying directives directly in templates.

Quick Start

Create a sample Svelte component that uses {@attach} to add a reactive tooltip to a button.

Frequently Asked Questions about svelte-template-directives

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

FAQPage Schema
How do I use Svelte template directives for reactive DOM manipulation?

Svelte template directives enable reactive DOM manipulation by applying directive-driven behaviors directly in component templates, allowing dynamic HTML rendering and interactive widget updates with minimal boilerplate. The Skill provides reference patterns for implementing these reactive UI behaviors.

What is the @attach directive in Svelte and when should I use it?

The @attach directive in Svelte facilitates integrating third-party libraries and dynamic elements like tooltips directly within templates. Use @attach when building interactive components that require directive-driven behaviors and clean DOM updates without extensive manual JavaScript wiring.

Does the @html and @render directive system require a specific Svelte version?

Yes, using the @html and @render directive system requires Svelte 5.29 or higher. The template directives rely on a frontmatter-driven metadata system within this version to properly support reactive snippet rendering and dynamic HTML updates across web applications.

How do I add a reactive tooltip to a Svelte button using template directives?

To add a reactive tooltip to a Svelte button, use the {@attach} directive directly in your component template to bind the tooltip library behavior. This directive-driven approach handles DOM manipulation reactively, minimizing boilerplate while maintaining dynamic UI updates.

What is the best way to render dynamic HTML in Svelte 5 components?

The best way to render dynamic HTML in Svelte 5 components is using template directives like {@html} and {@render}. These directives streamline reactive UI patterns, enabling clean and maintainable DOM updates for dynamic content rendering within your web application.

Why use Svelte snippets and template directives instead of standard reactivity?

Svelte snippets and template directives provide directive-driven DOM manipulation that reduces boilerplate compared to standard reactivity. They streamline interactive UI patterns by applying behaviors directly in templates, resulting in cleaner and more maintainable component code for dynamic rendering.