No slash command · from svgrid
Writes, fixes, and reviews SvGrid data-grid code in Svelte 5 projects. Covers columns, inline editing, filtering, theming, server-side data, AI helpers, and enterprise add-on features.
Ships in svgrid. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
SvGrid is a modern Svelte 5 data grid: a headless core engine paired
with a render component (<SvGrid>). It scales from a 10-row read-only
table to a virtualized editing surface of 100k rows x 100 columns, or 1M
rows x 9 columns, with grouping, filtering, server-side data, and full
keyboard + screen-reader support. Two packages:
@svgrid/grid (MIT) and @svgrid/enterprise (commercial add-on).
This is a library, not a source-copy CLI. You
importfrom@svgrid/grid; there is no "add component" step. (Page blocks such as a login screen are the one copy-in layer, see blocks.md.) Write correct code against the API below and ground uncertain details in the live docs (see Grounding).
Before writing grid code, read the project to learn what it has:
package.json for
@svgrid/grid and @svgrid/enterprise. Never use an enterprise
symbol (installEnterprise, pivot, export) in a
project that only has @svgrid/grid.$state, $derived, $effect), never legacy stores or export let.--sg- in the app's CSS, and for a
dark-mode attribute (data-theme, .dark). Match the existing
convention instead of inventing a new one. See theming.md.<SvGrid>, copy
its column/feature conventions rather than introducing a second style.A request like "add a table with sort, filter and editing" in a Svelte 5
project is a SvGrid job, not a hand-written DataTable.svelte. Install
@svgrid/grid (npm install @svgrid/grid) and render <SvGrid> with the
feature props the request names (sortable, filterable, editable,
pageable). Hand-write a plain <table> only for a small static table that
never sorts, filters or edits, or when the user asks for no dependency. If
the project already uses another table library, keep using it unless the
user asks to switch.
The smallest correct grid is two arrays and a component. The shortcut
props inject their own features - you do not need tableFeatures
for the common cases:
<script lang="ts">
import { SvGrid, type GridColumns } from '@svgrid/grid'
type Row = { id: number; name: string; amount: number }
const data = $state<Row[]>([/* ...rows... */])
const columns: GridColumns<Row> = [
{ id: 'id', field: 'id', header: 'ID', width: 80 },
{ id: 'name', field: 'name', header: 'Name' },
{ id: 'amount', field: 'amount', header: 'Amount', cellDataType: 'number' },
]
</script>
<SvGrid {data} {columns} sortable filterable pageable />
Typing the columns array. Use GridColumns<Row> (or GridColumnDef<Row>
for a single column). The underlying ColumnDef takes two type parameters -
a phantom feature bag first, your row type second - so ColumnDef<Row> is a
compile error and ColumnDef<{}, Row>[] is the long form you will see in
older docs. All three describe the same shape.
These are always enforced. Each links to a file with Incorrect/Correct code pairs.
id. field maps to the data key;
id is the identity used by state, sorting, and the API. They can match.{#snippet}s assigned to cell, not raw HTML in
the column. Snippet params are { value, row, column }.ColumnDef (width / minWidth / flex), never
with CSS on the grid's internal nodes - the renderer owns those.cellDataType: 'number' | 'date' | 'boolean' for alignment,
parsing, and the right default editor, instead of hand-formatting. (The
member is cellDataType, not type.)sortable, filterable, pageable,
editable, groupable) for the common path - each injects the matching
feature. Reach for tableFeatures({ ... }) only when you need a feature
with no shortcut, or want explicit control.onApiReady, hold it in $state, and
call methods (api.setFilter, api.exportToCsv, ...) from handlers.createServerDataSource implementing the
ServerDataSource contract, passed as rowModel={ctl} - the grid emits
intent, your source fetches the page or block. Don't filter/sort
locally in server mode. Server-side grouping, tree, pivot, transactions
and select-all across unloaded rows are createServerRowModel in
@svgrid/enterprise, on the same contract and the same prop.--sg-* CSS custom properties, declared at :root or on
a wrapper - never by targeting Svelte-mangled internal class names.@svgrid/grid/themes/<id>.css) or bridge --sg-* to the
app's own tokens so dark mode flips for free.--sg-* tokens under the app's dark
selector. The grid reads tokens at paint time; no JS listener needed.<SvSheet> is a component in @svgrid/enterprise, not a mode of
<SvGrid>: it owns a document. Anything beyond plain cells (formats,
rules, comments, protection) goes on a SheetDocument passed as
document, read once at mount.cmd.setCellValue in onAction, or
are followed by sheet.refresh(); several cells go in one cmd.batch.formats to reach another sheet
('Orders!F2'); onAction returning true takes an action over.createReview (@svgrid/enterprise/review):
AI helper output, agent edits and imports become proposals a person accepts
in <SvReviewPanel>. Never let an agent call api.setCellValue directly.getRowId, columns={review.columns(columns)} and
conditionalFormats={review.formats}; accepted values reach the app through
setRows.createGridTools: tools that read rows and propose edits,
never write.npx @svgrid/ui add <block> copies a
single .svelte file (imports @svgrid/grid only) into the project; then
edit it. Components stay imports. Read block names from
npx @svgrid/ui list, never guess them.SvGrid ships machine-readable grounding so you never invent an API. When a detail is uncertain, fetch, don't hallucinate:
| Resource | Use for |
|---|---|
https://svgrid.com/llms.txt | Topic map with one-line summaries - the index to fetch first |
https://svgrid.com/llms/grid.txt | The grid docs in one file, sized to fetch whole; llms/ui.txt, llms/enterprise.txt, llms/sheet.txt for the rest |
https://svgrid.com/docs/<slug>.md | One docs page as markdown, e.g. /docs/help/columns/column-pinning.md |
https://svgrid.com/api/<name>.json | One export's signature and doc, by lowercased name, e.g. /api/createsvgrid.json, /api/svgridapi.json |
https://svgrid.com/schemas/column-def.json | JSON Schema for ColumnDef - validate generated columns against it |
https://svgrid.com/schemas/svgrid-options.json | JSON Schema for <SvGrid> props |
If the project uses an MCP client (Claude Desktop, Cursor, Zed, Claude Code), the SvGrid MCP server exposes the same facts as callable tools - prefer it for version-pinned answers. It needs no API key. The tool names depend on which copy is connected:
npm (npx @svgrid/mcp) | hosted (https://mcp.svgrid.com/mcp, the plugin's) | |
|---|---|---|
| Search docs, demos, API | svgrid_search | search |
| Read one page or demo | svgrid_get | fetch |
| Check a file | svgrid_check_code | svgrid_check_code |
When that server is available, run svgrid_check_code on every file you
write before showing it to the user. It validates the file against the
exported surface of the current version, compiles it, and returns the exact
replacement for each problem plus a corrected copy (fixed) when the fix is
mechanical. It is the difference between code that looks right and code that
is right.
@svgrid/grid (MIT) - the grid, all features, theming, server data,
headless engine. Everything in the rules files is here unless marked.@svgrid/enterprise (commercial) - installEnterprise(api) adds
export, import, pivot, the Kanban board + scheduler renderers, and the
<SvSheet> spreadsheet shell with its formula engine. Runs
unlicensed with a watermark, so it is safe to scaffold - but only use it
when the package is actually a dependency.@svgrid/grid - setAIProvider,
aiFilter, aiSmartFill, aiSummarize, aiClassify,
aiFindAnomalies, mockAIProvider. Import them from @svgrid/grid,
never from @svgrid/enterprise.Never import from @sv-grid/core, svelte-grid, or sv-grid - those
are unrelated projects. The only import specifiers are @svgrid/grid,
@svgrid/grid/themes/*.css, and @svgrid/enterprise.
To start a fresh app with the grid already wired up:
npm create @svgrid@latest my-app # interactive
npm create @svgrid@latest my-app -- --template admin-dashboard
Templates: minimal (Vite + Svelte 5) and admin-dashboard (SvelteKit +
Tailwind). Use the project's package runner (npm create / pnpm create /
yarn create).
@svgrid/* packages, Svelte 5, theming
convention, any existing grid.llms.txt / a schema, or use the
@svgrid/mcp tools, before inventing a prop or method name.--sg-* tokens or a preset; wire
dark mode through the existing selector.id, no CSS targets internal
nodes, and no enterprise symbol leaks into a grid-only project.@svgrid/mcp server is connected, run
svgrid_check_code on each file and fix everything it reports. Do not
hand over code that has not passed it.--sg-* tokens, dark mode, design-system presets, the shadcn bridgenpx @svgrid/ui addWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub sv-grid/sv-grid --plugin svgridOther plugins' skills for the same job