Svelte

Svelte framework commands for building web applications

21 commands
Search & Copy
Save Favorites
21
Total Commands
100%
Free Access
Lightning Fast

Available Commands

Click on any command to copy it instantly

21 commands available
21 of 21
svelte

Create Svelte App

Create a new Svelte application

npm create svelte@latest my-app
svelte
create
app
svelte

Start Development Server

Start Svelte development server

npm run dev
svelte
dev
server
svelte

Build for Production

Build Svelte app for production

npm run build
svelte
build
production
svelte

Preview Production Build

Preview the production build

npm run preview
svelte
preview
production
svelte

Type Checking

Run Svelte type checking

npm run check
svelte
check
types
svelte

Create Component

Create a new Svelte component

touch src/lib/MyComponent.svelte
svelte
component
create
svelte

Create Store

Create a Svelte store

touch src/lib/stores/myStore.js
svelte
store
state
svelte

SvelteKit Commands

SvelteKit specific commands

npx svelte-kit sync
svelte
kit
framework
svelte

Add Svelte Add-ons

Add Svelte integrations

npx svelte-add tailwindcss
svelte
add
integrations
svelte

Testing Setup

Set up testing for Svelte

npm install -D @testing-library/svelte vitest
svelte
test
testing
svelte

Linting Setup

Set up linting for Svelte

npm install -D eslint-plugin-svelte3
svelte
lint
eslint
svelte

Deploy Svelte App

Deploy Svelte application

npm run build && npx serve build
svelte
deploy
build
svelte

Server-Side Rendering

Configure SSR with SvelteKit

npm run build
svelte
ssr
rendering
svelte

File-based Routing

Create routes in SvelteKit

touch src/routes/about/+page.svelte
svelte
routing
pages
svelte

Data Loading

Load data in SvelteKit

touch src/routes/+page.js
svelte
load
data
svelte

Svelte Actions

Create reusable actions

touch src/lib/actions/clickOutside.js
svelte
actions
reusable
svelte

Transitions and Animations

Add transitions to Svelte

import { fade, fly } from "svelte/transition"
svelte
transitions
animations
svelte

Scoped Styles

Write scoped CSS in Svelte

<style> .my-class { color: red; } </style>
svelte
styles
css
svelte

Component Props

Define component props

export let name = "default"
svelte
props
components
svelte

Event Handling

Handle events in Svelte

on:click={handleClick}
svelte
events
handlers
svelte

Reactive Statements

Create reactive statements

$: doubled = count * 2
svelte
reactive
statements

Missing a command?

Help us improve this collection by suggesting commands that should be added. Your contributions help the entire developer community!