ui-route

Solid

Create SvelteKit routes and Svelte 5 components for the Traceway UI. Use when building new pages, components, or frontend features.

Web & Frontend 364 stars 68 forks Updated today MIT

Install

View on GitHub

Quality Score: 92/100

Stars 20%
85
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Create UI Route or Component Use this skill when the user asks to add a new page, route, or component to the SvelteKit frontend. ## Creating a new route Routes live in `ui/src/routes/`. SvelteKit uses file-based routing. ### Route file structure ``` ui/src/routes/<route-name>/ ├── +page.svelte # Page component ├── +page.ts # Load function (optional, for SSR data) └── +layout.svelte # Layout wrapper (optional, inherits parent) ``` ### Page template (Svelte 5 runes) ```svelte <script lang="ts"> import { onMount } from 'svelte'; import { API_BASE, type MyType } from '$lib/api'; // State — use $state(), never Svelte 4 stores let items: MyType[] = $state([]); let loading = $state(true); let error = $state(''); // Derived values — use $derived() let itemCount = $derived(items.length); let hasItems = $derived(items.length > 0); // Complex derived — use $derived.by() let summary = $derived.by(() => { return items.reduce((acc, item) => acc + item.value, 0); }); // Side effects — use $effect() $effect(() => { console.log(`Items changed: ${items.length}`); }); onMount(async () => { try { const res = await fetch(`${API_BASE}/internal/my-endpoint?org_id=...&project_id=...`); items = await res.json(); } catch (e: any) { error = e?.message || 'Failed to load'; } loading = false; }); </script> <div class="app-shell-wide"> {#if loading} <p class="text-zinc-500 text-sm">Loading...<...

Details

Author
majiayu000
Repository
majiayu000/claude-skill-registry
Created
5 months ago
Last Updated
today
Language
HTML
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category