Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

svelte-template-directives

БесплатноБез исполняемых скриптовНе проверен

Svelte template directives ({@attach}, {@html}, {@render}, {@const}, {@debug}). Use for DOM manipulation, third-party libs, tooltips, canvas, dynamic HTML…

spences10от spences10★ 96 звёзд на GitHub

Об этом скилле

Svelte Template Directives

@attach (Svelte 5.29+)

The reactive alternative to use: actions. Re-runs when dependencies change, passes through components via spread, supports cleanup functions.

<script>
	import ImageZoom from 'js-image-zoom';

	function useZoom(options) {
		return (element) => {
			new ImageZoom(element, options);
			return () => console.log('cleanup');
		};
	}
</script>

<!-- Re-runs if options changes (use: wouldn't!) -->
<figure {@attach useZoom({ width: 400 })}>
	<img src="photo.jpg" alt="zoomable" />
</figure>

Quick Reference

Directive Purpose Reactive?
{@attach} DOM manipulation, 3rd-party Yes
{@html} Render raw HTML strings Yes
{@render} Render snippets Yes
{@const} Local constants in blocks N/A
{@debug} Pause debugger on value change N/A
{#each (key)} Keyed iteration (always key!) Yes
<svelte:window> Window event listeners N/A

@attach vs use: Actions

Feature use: @attach
Re-runs on arg change No Yes
Composable Limited Fully
Pass through props Manual Auto via spread
Convert legacy N/A fromAction()

Reference Files

Notes

  • @attach requires Svelte 5.29+
  • Use fromAction from svelte/attachments to convert legacy actions
  • Attachments pass through wrapper components when you spread props
  • Always use keyed each blocks — never use index as key
  • Use <svelte:window>/<svelte:document> for global events, not $effect
  • Last verified: 2026-03-12

Установить svelte-template-directives в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/attach-patterns.mdreferences/other-directives.md

FAQ

Что делает скилл svelte-template-directives?

Svelte template directives ({@attach}, {@html}, {@render}, {@const}, {@debug}). Use for DOM manipulation, third-party libs, tooltips, canvas, dynamic HTML. @attach replaces use: actions.

Как установить скилл svelte-template-directives?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл svelte-template-directives запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить svelte-template-directives с