diff --git a/site/content/docs/02-template-syntax.md b/site/content/docs/02-template-syntax.md index e93449728b..74beaa2358 100644 --- a/site/content/docs/02-template-syntax.md +++ b/site/content/docs/02-template-syntax.md @@ -342,6 +342,31 @@ If you don't care about the pending state, you can also omit the initial block. {/await} ``` +### {#key ...} + +```sv +{#key expression}...{/key} +``` + +--- + +Key block destroys and recreates the elements when the value of the expression changes. + +This is useful if you want to transition the element whenever the expression value changes. + +```sv +{#key value} +