Svelte 5 runes, component patterns, reactivity, and SvelteKit data loading best practices
99
99%
Does it follow best practices?
Impact
99%
1.11xAverage score across 10 eval scenarios
Passed
No known issues
A SaaS platform team needs a reusable data table component in Svelte 5 for their admin dashboard. They have several different data views (users, invoices, products) and want a single generic table shell that handles the column headers and row structure, while letting each page control exactly how each row's cells are rendered. This is important because different pages need completely different cell content — some need badges, icons, or action buttons, while others just need plain text.
The component should be flexible enough that the parent page passes a snippet defining how to render each row, and the table component iterates over the data and renders each row using that snippet. This keeps the table reusable across contexts without needing to pass complex render functions or sacrifice type safety.
The team is building this with Svelte 5 and TypeScript. They plan to load the table data from an API endpoint (or a mock fetch) and want the data storage to be as efficient as possible given that the data is always replaced wholesale when refreshed.
Create the following files:
src/lib/DataTable.svelte — A generic, reusable table component that:
src/routes/users/+page.svelte — A page that:
The files should be written for Svelte 5 with TypeScript.
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
skills
svelte-best-practices