en un clic
svelte-frontend
// Svelte coding guidelines for the Windmill frontend. MUST use when writing or modifying code in the frontend directory.
// Svelte coding guidelines for the Windmill frontend. MUST use when writing or modifying code in the frontend directory.
MUST use when writing Bun/TypeScript scripts.
MUST use when writing Bun Native scripts.
MUST use when writing Deno/TypeScript scripts.
MUST use when writing Native TypeScript scripts.
MUST use when using the CLI, including debugging job failures and inspecting run history via `wmill job`.
MUST use when creating raw apps.
| name | svelte-frontend |
| description | Svelte coding guidelines for the Windmill frontend. MUST use when writing or modifying code in the frontend directory. |
Apply these Windmill-specific patterns when writing Svelte code in frontend/. For general Svelte 5 syntax (runes, snippets, event handling), use the Svelte MCP server.
Always use Windmill's design-system components. Never use raw HTML elements.
<Button><script>
import { Button } from '$lib/components/common'
import { ChevronLeft } from 'lucide-svelte'
</script>
<Button variant="default" onclick={handleClick}>Label</Button>
<Button startIcon={{ icon: ChevronLeft }} iconOnly onclick={prev} />
Props: variant?: 'accent' | 'accent-secondary' | 'default' | 'subtle', unifiedSize?: 'sm' | 'md' | 'lg', startIcon?: { icon: SvelteComponent }, iconOnly?: boolean, disabled?: boolean
<TextInput><script>
import { TextInput } from '$lib/components/common'
</script>
<TextInput bind:value={val} placeholder="Enter value" />
Props: value?: string | number (bindable), placeholder?: string, disabled?: boolean, error?: string | boolean, size?: 'sm' | 'md' | 'lg'
<Select><script>
import Select from '$lib/components/select/Select.svelte'
</script>
<Select items={[{ label: 'Jan', value: 1 }]} bind:value={selected} />
Props: items?: Array<{ label?: string; value: any }>, value (bindable), placeholder?: string, clearable?: boolean, size?: 'sm' | 'md' | 'lg'
lucide-svelteNever write inline SVGs. Import from lucide-svelte:
<script>
import { ChevronLeft, X } from 'lucide-svelte'
</script>
<ChevronLeft size={16} />
Form components (TextInput, Toggle, Select, etc.) should use the unified size system when placed together.
frontend/brand-guidelines.md)Use the Svelte MCP tools when working on Svelte code:
After changing Svelte code, use the Playwright MCP (mcp__playwright__*) to drive the running frontend and confirm the change works. See AGENTS.md → "Verifying Frontend Changes" for the full flow. Use playwright (headless) on devboxes; playwright-headed when a display is available.