Svelte Awesome Snippets for VSCodeAwesome, easy to remember snippets for Svelte and Svelte-Kit (using TypeScript). Uses type inference when possible. No unnecessary type imports. Snippets structure:
Naming convention:All snippets start with sv. I had a distinction between Svelte and Svelte Kit commands (sv or sk) but I decided against it as it adds mental overhead remembering the distinction. Added support for Svelte 5 API:
Awesome Svelte Snippets on VSCode Marketplace. For bugs or feedback, please open an issue on Github. SnippetsSVELTE KITsvpage - Page
svscript - Script
svmodule - Script Module
svload - Load
svactions - Actions
svhooks - Hooks
SVELTE TSsvstate - Create a rune state variable
svderived - Create a rune derived variable
sveffect - Create a rune effect, including cleanup. Even if you don't need it, it's a good to atleast remind yourself that you should think about it.
SVELTEsvdispatch - Event Dispatcher
svhead - Head Tag
svforeach - For Each
svforeachelse - For Each else
svif - If
svifelse - If Else
svifelseif - If Else If
svawait - Await
svkey - Key
NoteThe snippets include "$1", "$2"... which are placeholders for the cursor position. You can use the tab key to jump between them. LicenseMIT CreditsForked from svelte-snippets, thank you very much! |