@svgrid/create 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -25
- package/README.md +22 -3
- package/index.mjs +1 -1
- package/package.json +4 -4
- package/templates/admin-dashboard/README.md +86 -77
- package/templates/admin-dashboard/src/routes/+layout.svelte +115 -115
- package/templates/minimal/README.md +32 -21
package/LICENSE
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
This repository is a multi-package workspace. Different packages ship
|
|
2
|
-
under different licenses. The authoritative license for each package is
|
|
3
|
-
the LICENSE file inside that package directory.
|
|
4
|
-
|
|
5
|
-
------------------------------------------------------------------------
|
|
6
|
-
Per-package licensing
|
|
7
|
-
------------------------------------------------------------------------
|
|
8
|
-
|
|
9
|
-
packages/grid/ MIT (terms below, and packages/grid/LICENSE)
|
|
10
|
-
packages/enterprise/ Commercial - see packages/enterprise/LICENSE
|
|
11
|
-
packages/mcp/ Commercial - see packages/mcp/LICENSE
|
|
12
|
-
website/ Proprietary - see website/LICENSE
|
|
13
|
-
|
|
14
|
-
Only `@svgrid/grid` is open source. Everything else in this
|
|
15
|
-
repository (the Pro feature pack, the MCP server, the marketing +
|
|
16
|
-
docs website, and any other package added later that does not ship
|
|
17
|
-
its own MIT LICENSE) is proprietary and may not be copied, modified,
|
|
18
|
-
or redistributed without a paid license. Source is visible in this
|
|
19
|
-
repository for transparency and for paying customers; visibility does
|
|
20
|
-
not grant a license.
|
|
21
|
-
|
|
22
|
-
------------------------------------------------------------------------
|
|
23
|
-
MIT License (applies ONLY to packages/grid)
|
|
24
|
-
------------------------------------------------------------------------
|
|
25
|
-
|
|
26
1
|
MIT License
|
|
27
2
|
|
|
28
3
|
Copyright (c) 2026 jQWidgets Ltd
|
package/README.md
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://svgrid.com/brand/svgrid-logo-icon-1200.png" alt="SvGrid" width="100" height="100" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">@svgrid/create</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center"><strong>Scaffold a Svelte 5 app with a data grid already wired up.</strong></p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/@svgrid/create"><img src="https://img.shields.io/npm/v/%40svgrid%2Fcreate.svg?label=%40svgrid%2Fcreate" alt="npm version" /></a>
|
|
11
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License" /></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://svgrid.com">Website</a> ·
|
|
16
|
+
<a href="https://svgrid.com/docs/">Docs</a> ·
|
|
17
|
+
<a href="https://svgrid.com/demos/">Demos</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
---
|
|
2
21
|
|
|
3
22
|
Scaffold a [Svelte](https://svelte.dev) app powered by
|
|
4
|
-
[SvGrid](https://
|
|
23
|
+
[SvGrid](https://svgrid.com) - the Svelte 5 data grid and data table - in one
|
|
5
24
|
command.
|
|
6
25
|
|
|
7
26
|
```bash
|
|
@@ -52,7 +71,7 @@ npm run dev
|
|
|
52
71
|
```
|
|
53
72
|
|
|
54
73
|
All templates use the free MIT `@svgrid/grid` core. Add
|
|
55
|
-
[`@svgrid/enterprise`](https://
|
|
74
|
+
[`@svgrid/enterprise`](https://svgrid.com/pricing/) for Excel/PDF export, import,
|
|
56
75
|
print, pivot, and AI helpers.
|
|
57
76
|
|
|
58
77
|
SvGrid(TM) is a trademark of jQWidgets Ltd. This package is MIT-licensed.
|
package/index.mjs
CHANGED
|
@@ -351,7 +351,7 @@ async function main() {
|
|
|
351
351
|
stdout.write(` cd ${target}\n`)
|
|
352
352
|
stdout.write(` npm install\n`)
|
|
353
353
|
stdout.write(` npm run dev\n\n`)
|
|
354
|
-
stdout.write(`${color('dim', 'Docs:')} https://
|
|
354
|
+
stdout.write(`${color('dim', 'Docs:')} https://svgrid.com/docs ${color('dim', 'Pro:')} https://svgrid.com/pricing\n\n`)
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
main().catch((err) => {
|
package/package.json
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
"type": "commercial",
|
|
5
5
|
"url": "https://svgrid.com/pricing"
|
|
6
6
|
},
|
|
7
|
-
"version": "2.2.
|
|
7
|
+
"version": "2.2.1",
|
|
8
8
|
"description": "Scaffold a Svelte app powered by SvGrid in one command: npm create @svgrid@latest",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"author": "jQWidgets Ltd",
|
|
12
|
-
"homepage": "https://
|
|
12
|
+
"homepage": "https://svgrid.com",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/sv-grid/sv-grid.git",
|
|
15
|
+
"url": "git+https://github.com/sv-grid/sv-grid.git",
|
|
16
16
|
"directory": "packages/create-sv-grid"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"node": ">=18"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@svgrid/grid": "^2.2.
|
|
39
|
+
"@svgrid/grid": "^2.2.27"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"sync-templates": "node sync-templates.mjs"
|
|
@@ -1,77 +1,86 @@
|
|
|
1
|
-
# SvGrid Admin Dashboard (SvelteKit starter)
|
|
2
|
-
|
|
3
|
-
A production-ready admin dashboard built with **[SvelteKit](https://svelte.dev/docs/kit)**
|
|
4
|
-
and **[SvGrid](https://
|
|
5
|
-
Sortable, filterable, editable grids; KPI cards; a sidebar shell; prerendered
|
|
6
|
-
to static HTML for SEO; one-click deploy to Vercel.
|
|
7
|
-
|
|
8
|
-

|
|
9
|
-
|
|
10
|
-
## Deploy
|
|
11
|
-
|
|
12
|
-
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fsv-grid%2Fsv-grid%2Ftree%2Fmain%2Ftemplates%2Fsveltekit-admin-dashboard&project-name=sv-grid-admin&repository-name=sv-grid-admin)
|
|
13
|
-
|
|
14
|
-
> Deploying from this monorepo subfolder? In the Vercel import step set the
|
|
15
|
-
> **Root Directory** to `templates/sveltekit-admin-dashboard`. Or scaffold a
|
|
16
|
-
> standalone copy first (recommended):
|
|
17
|
-
>
|
|
18
|
-
> ```bash
|
|
19
|
-
> npm create
|
|
20
|
-
> ```
|
|
21
|
-
|
|
22
|
-
## Quick start
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm install
|
|
26
|
-
npm run dev # http://localhost:5173
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm run build # static + serverless output via adapter-vercel
|
|
31
|
-
npm run preview # preview the production build
|
|
32
|
-
npm run check # svelte-check (types)
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## What's inside
|
|
36
|
-
|
|
37
|
-
| Path | What it shows |
|
|
38
|
-
| --- | --- |
|
|
39
|
-
| `src/routes/+layout.svelte` | App shell: sidebar nav + top bar |
|
|
40
|
-
| `src/routes/+page.svelte` | Overview: KPI cards + a recent-orders grid |
|
|
41
|
-
| `src/routes/orders/+page.svelte` | Full grid: sort, filter, **row select**, inline edit, pagination |
|
|
42
|
-
| `src/routes/customers/+page.svelte` | Grid with **column grouping** (drag a column to the group bar) |
|
|
43
|
-
| `src/lib/data.ts` | Deterministic sample data - swap for your API / `load()` |
|
|
44
|
-
| `src/lib/types.ts` | `Order` / `Customer` row types |
|
|
45
|
-
|
|
46
|
-
The grids mount client-side (`{#if browser}`) while the shell and headings
|
|
47
|
-
prerender to crawlable HTML - good for SEO and instant first paint. Every
|
|
48
|
-
route is `prerender = true` (see `src/routes/+layout.ts`); delete that line
|
|
49
|
-
on any route that needs SSR or runtime data.
|
|
50
|
-
|
|
51
|
-
## Wiring your own data
|
|
52
|
-
|
|
53
|
-
Replace the calls to `makeOrders()` / `makeCustomers()` in each route with a
|
|
54
|
-
SvelteKit [`load`](https://svelte.dev/docs/kit/load) function:
|
|
55
|
-
|
|
56
|
-
```ts
|
|
57
|
-
// src/routes/orders/+page.ts
|
|
58
|
-
export async function load({ fetch }) {
|
|
59
|
-
const orders = await fetch('/api/orders').then((r) => r.json())
|
|
60
|
-
return { orders }
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Then read `data.orders` in the page via `let { data } = $props()`.
|
|
65
|
-
|
|
66
|
-
## Upgrade to Pro
|
|
67
|
-
|
|
68
|
-
This starter uses the free MIT **`@svgrid/grid`** core
|
|
69
|
-
export, data import, printing,
|
|
70
|
-
[`@svgrid/enterprise`](https://
|
|
71
|
-
the grid's API.
|
|
72
|
-
it.
|
|
73
|
-
|
|
74
|
-
##
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1
|
+
# SvGrid Admin Dashboard (SvelteKit starter)
|
|
2
|
+
|
|
3
|
+
A production-ready admin dashboard built with **[SvelteKit](https://svelte.dev/docs/kit)**
|
|
4
|
+
and **[SvGrid](https://svgrid.com)** - the Svelte 5 data grid and data table.
|
|
5
|
+
Sortable, filterable, editable grids; KPI cards; a sidebar shell; prerendered
|
|
6
|
+
to static HTML for SEO; one-click deploy to Vercel.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
## Deploy
|
|
11
|
+
|
|
12
|
+
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fsv-grid%2Fsv-grid%2Ftree%2Fmain%2Ftemplates%2Fsveltekit-admin-dashboard&project-name=sv-grid-admin&repository-name=sv-grid-admin)
|
|
13
|
+
|
|
14
|
+
> Deploying from this monorepo subfolder? In the Vercel import step set the
|
|
15
|
+
> **Root Directory** to `templates/sveltekit-admin-dashboard`. Or scaffold a
|
|
16
|
+
> standalone copy first (recommended):
|
|
17
|
+
>
|
|
18
|
+
> ```bash
|
|
19
|
+
> npm create @svgrid@latest my-admin -- --template admin-dashboard
|
|
20
|
+
> ```
|
|
21
|
+
|
|
22
|
+
## Quick start
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install
|
|
26
|
+
npm run dev # http://localhost:5173
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm run build # static + serverless output via adapter-vercel
|
|
31
|
+
npm run preview # preview the production build
|
|
32
|
+
npm run check # svelte-check (types)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## What's inside
|
|
36
|
+
|
|
37
|
+
| Path | What it shows |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `src/routes/+layout.svelte` | App shell: sidebar nav + top bar |
|
|
40
|
+
| `src/routes/+page.svelte` | Overview: KPI cards + a recent-orders grid |
|
|
41
|
+
| `src/routes/orders/+page.svelte` | Full grid: sort, filter, **row select**, inline edit, pagination |
|
|
42
|
+
| `src/routes/customers/+page.svelte` | Grid with **column grouping** (drag a column to the group bar) |
|
|
43
|
+
| `src/lib/data.ts` | Deterministic sample data - swap for your API / `load()` |
|
|
44
|
+
| `src/lib/types.ts` | `Order` / `Customer` row types |
|
|
45
|
+
|
|
46
|
+
The grids mount client-side (`{#if browser}`) while the shell and headings
|
|
47
|
+
prerender to crawlable HTML - good for SEO and instant first paint. Every
|
|
48
|
+
route is `prerender = true` (see `src/routes/+layout.ts`); delete that line
|
|
49
|
+
on any route that needs SSR or runtime data.
|
|
50
|
+
|
|
51
|
+
## Wiring your own data
|
|
52
|
+
|
|
53
|
+
Replace the calls to `makeOrders()` / `makeCustomers()` in each route with a
|
|
54
|
+
SvelteKit [`load`](https://svelte.dev/docs/kit/load) function:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
// src/routes/orders/+page.ts
|
|
58
|
+
export async function load({ fetch }) {
|
|
59
|
+
const orders = await fetch('/api/orders').then((r) => r.json())
|
|
60
|
+
return { orders }
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Then read `data.orders` in the page via `let { data } = $props()`.
|
|
65
|
+
|
|
66
|
+
## Upgrade to Pro
|
|
67
|
+
|
|
68
|
+
This starter uses the free MIT **`@svgrid/grid`** core, which already includes
|
|
69
|
+
the AI helpers. For Excel/PDF export, data import, printing, and pivot tables,
|
|
70
|
+
add [`@svgrid/enterprise`](https://svgrid.com/pricing/) and call
|
|
71
|
+
`installEnterprise(api)` on the grid's API. It runs in evaluation with a
|
|
72
|
+
watermark, so no key is needed to try it.
|
|
73
|
+
|
|
74
|
+
## Working with an AI assistant
|
|
75
|
+
|
|
76
|
+
Point it at the SvGrid MCP server so it writes against the real API instead of
|
|
77
|
+
guessing:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
claude mcp add svgrid -- npx -y @svgrid/mcp
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
Built with [SvGrid](https://svgrid.com). This template is MIT-licensed - use it
|
|
86
|
+
as the basis for your own app. SvGrid(TM) is a trademark of jQWidgets Ltd.
|
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import '../app.css'
|
|
3
|
-
import { page } from '$app/state'
|
|
4
|
-
import { onMount } from 'svelte'
|
|
5
|
-
import { readTheme, applyTheme, type Theme } from '$lib/theme'
|
|
6
|
-
|
|
7
|
-
let { children } = $props()
|
|
8
|
-
|
|
9
|
-
// Theme: dark by default (see app.html), toggleable + persisted.
|
|
10
|
-
let theme = $state<Theme>('dark')
|
|
11
|
-
onMount(() => {
|
|
12
|
-
theme = readTheme()
|
|
13
|
-
applyTheme(theme)
|
|
14
|
-
})
|
|
15
|
-
function toggleTheme() {
|
|
16
|
-
theme = theme === 'dark' ? 'light' : 'dark'
|
|
17
|
-
applyTheme(theme)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const nav = [
|
|
21
|
-
{ href: '/', label: 'Overview', icon: '▦' },
|
|
22
|
-
{ href: '/orders', label: 'Orders', icon: '🧾' },
|
|
23
|
-
{ href: '/customers', label: 'Customers', icon: '👥' },
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
function isActive(href: string): boolean {
|
|
27
|
-
return href === '/' ? page.url.pathname === '/' : page.url.pathname.startsWith(href)
|
|
28
|
-
}
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<div class="flex h-full min-h-screen">
|
|
32
|
-
<!-- Sidebar -->
|
|
33
|
-
<aside
|
|
34
|
-
class="hidden w-60 shrink-0 flex-col border-r md:flex"
|
|
35
|
-
style="border-color: var(--app-border); background: var(--app-panel);"
|
|
36
|
-
>
|
|
37
|
-
<div class="flex items-center gap-2 px-5 py-4">
|
|
38
|
-
<span
|
|
39
|
-
class="grid h-8 w-8 place-items-center rounded-lg font-bold text-white"
|
|
40
|
-
style="background: var(--app-accent);">S</span
|
|
41
|
-
>
|
|
42
|
-
<div class="leading-tight">
|
|
43
|
-
<p class="text-sm font-bold" style="color: var(--app-fg);">SvGrid Admin</p>
|
|
44
|
-
<p class="text-[11px]" style="color: var(--app-muted);">Dashboard starter</p>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
<nav class="mt-2 flex-1 px-3">
|
|
49
|
-
{#each nav as item}
|
|
50
|
-
<a
|
|
51
|
-
href={item.href}
|
|
52
|
-
class="mb-1 flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors"
|
|
53
|
-
style={isActive(item.href)
|
|
54
|
-
? 'background: var(--app-accent); color: #fff;'
|
|
55
|
-
: 'color: var(--app-fg);'}
|
|
56
|
-
>
|
|
57
|
-
<span class="w-5 text-center">{item.icon}</span>
|
|
58
|
-
{item.label}
|
|
59
|
-
</a>
|
|
60
|
-
{/each}
|
|
61
|
-
</nav>
|
|
62
|
-
|
|
63
|
-
<div class="px-5 py-4 text-[11px]" style="color: var(--app-muted);">
|
|
64
|
-
Built with
|
|
65
|
-
<a class="underline" href="https://
|
|
66
|
-
+ SvelteKit
|
|
67
|
-
</div>
|
|
68
|
-
</aside>
|
|
69
|
-
|
|
70
|
-
<!-- Main -->
|
|
71
|
-
<div class="flex min-w-0 flex-1 flex-col">
|
|
72
|
-
<header
|
|
73
|
-
class="flex items-center justify-between border-b px-6 py-3"
|
|
74
|
-
style="border-color: var(--app-border); background: var(--app-panel);"
|
|
75
|
-
>
|
|
76
|
-
<h1 class="text-base font-semibold" style="color: var(--app-fg);">
|
|
77
|
-
{nav.find((n) => isActive(n.href))?.label ?? 'Dashboard'}
|
|
78
|
-
</h1>
|
|
79
|
-
<div class="flex items-center gap-2">
|
|
80
|
-
<button
|
|
81
|
-
type="button"
|
|
82
|
-
onclick={toggleTheme}
|
|
83
|
-
title={theme === 'dark' ? 'Switch to light mode' : 'Switch to dark mode'}
|
|
84
|
-
aria-label="Toggle theme"
|
|
85
|
-
class="grid h-9 w-9 place-items-center rounded-lg border"
|
|
86
|
-
style="border-color: var(--app-border); color: var(--app-fg);"
|
|
87
|
-
>
|
|
88
|
-
{#if theme === 'dark'}
|
|
89
|
-
<!-- sun -->
|
|
90
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
91
|
-
<circle cx="12" cy="12" r="4" />
|
|
92
|
-
<path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41" />
|
|
93
|
-
</svg>
|
|
94
|
-
{:else}
|
|
95
|
-
<!-- moon -->
|
|
96
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
97
|
-
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
|
|
98
|
-
</svg>
|
|
99
|
-
{/if}
|
|
100
|
-
</button>
|
|
101
|
-
<a
|
|
102
|
-
href="https://
|
|
103
|
-
target="_blank"
|
|
104
|
-
rel="noopener"
|
|
105
|
-
class="rounded-lg border px-3 py-1.5 text-sm font-medium"
|
|
106
|
-
style="border-color: var(--app-border); color: var(--app-fg);">Docs</a
|
|
107
|
-
>
|
|
108
|
-
</div>
|
|
109
|
-
</header>
|
|
110
|
-
|
|
111
|
-
<main class="min-w-0 flex-1 p-6">
|
|
112
|
-
{@render children()}
|
|
113
|
-
</main>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../app.css'
|
|
3
|
+
import { page } from '$app/state'
|
|
4
|
+
import { onMount } from 'svelte'
|
|
5
|
+
import { readTheme, applyTheme, type Theme } from '$lib/theme'
|
|
6
|
+
|
|
7
|
+
let { children } = $props()
|
|
8
|
+
|
|
9
|
+
// Theme: dark by default (see app.html), toggleable + persisted.
|
|
10
|
+
let theme = $state<Theme>('dark')
|
|
11
|
+
onMount(() => {
|
|
12
|
+
theme = readTheme()
|
|
13
|
+
applyTheme(theme)
|
|
14
|
+
})
|
|
15
|
+
function toggleTheme() {
|
|
16
|
+
theme = theme === 'dark' ? 'light' : 'dark'
|
|
17
|
+
applyTheme(theme)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const nav = [
|
|
21
|
+
{ href: '/', label: 'Overview', icon: '▦' },
|
|
22
|
+
{ href: '/orders', label: 'Orders', icon: '🧾' },
|
|
23
|
+
{ href: '/customers', label: 'Customers', icon: '👥' },
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
function isActive(href: string): boolean {
|
|
27
|
+
return href === '/' ? page.url.pathname === '/' : page.url.pathname.startsWith(href)
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<div class="flex h-full min-h-screen">
|
|
32
|
+
<!-- Sidebar -->
|
|
33
|
+
<aside
|
|
34
|
+
class="hidden w-60 shrink-0 flex-col border-r md:flex"
|
|
35
|
+
style="border-color: var(--app-border); background: var(--app-panel);"
|
|
36
|
+
>
|
|
37
|
+
<div class="flex items-center gap-2 px-5 py-4">
|
|
38
|
+
<span
|
|
39
|
+
class="grid h-8 w-8 place-items-center rounded-lg font-bold text-white"
|
|
40
|
+
style="background: var(--app-accent);">S</span
|
|
41
|
+
>
|
|
42
|
+
<div class="leading-tight">
|
|
43
|
+
<p class="text-sm font-bold" style="color: var(--app-fg);">SvGrid Admin</p>
|
|
44
|
+
<p class="text-[11px]" style="color: var(--app-muted);">Dashboard starter</p>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<nav class="mt-2 flex-1 px-3">
|
|
49
|
+
{#each nav as item}
|
|
50
|
+
<a
|
|
51
|
+
href={item.href}
|
|
52
|
+
class="mb-1 flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors"
|
|
53
|
+
style={isActive(item.href)
|
|
54
|
+
? 'background: var(--app-accent); color: #fff;'
|
|
55
|
+
: 'color: var(--app-fg);'}
|
|
56
|
+
>
|
|
57
|
+
<span class="w-5 text-center">{item.icon}</span>
|
|
58
|
+
{item.label}
|
|
59
|
+
</a>
|
|
60
|
+
{/each}
|
|
61
|
+
</nav>
|
|
62
|
+
|
|
63
|
+
<div class="px-5 py-4 text-[11px]" style="color: var(--app-muted);">
|
|
64
|
+
Built with
|
|
65
|
+
<a class="underline" href="https://svgrid.com" target="_blank" rel="noopener">SvGrid</a>
|
|
66
|
+
+ SvelteKit
|
|
67
|
+
</div>
|
|
68
|
+
</aside>
|
|
69
|
+
|
|
70
|
+
<!-- Main -->
|
|
71
|
+
<div class="flex min-w-0 flex-1 flex-col">
|
|
72
|
+
<header
|
|
73
|
+
class="flex items-center justify-between border-b px-6 py-3"
|
|
74
|
+
style="border-color: var(--app-border); background: var(--app-panel);"
|
|
75
|
+
>
|
|
76
|
+
<h1 class="text-base font-semibold" style="color: var(--app-fg);">
|
|
77
|
+
{nav.find((n) => isActive(n.href))?.label ?? 'Dashboard'}
|
|
78
|
+
</h1>
|
|
79
|
+
<div class="flex items-center gap-2">
|
|
80
|
+
<button
|
|
81
|
+
type="button"
|
|
82
|
+
onclick={toggleTheme}
|
|
83
|
+
title={theme === 'dark' ? 'Switch to light mode' : 'Switch to dark mode'}
|
|
84
|
+
aria-label="Toggle theme"
|
|
85
|
+
class="grid h-9 w-9 place-items-center rounded-lg border"
|
|
86
|
+
style="border-color: var(--app-border); color: var(--app-fg);"
|
|
87
|
+
>
|
|
88
|
+
{#if theme === 'dark'}
|
|
89
|
+
<!-- sun -->
|
|
90
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
91
|
+
<circle cx="12" cy="12" r="4" />
|
|
92
|
+
<path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41" />
|
|
93
|
+
</svg>
|
|
94
|
+
{:else}
|
|
95
|
+
<!-- moon -->
|
|
96
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
97
|
+
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
|
|
98
|
+
</svg>
|
|
99
|
+
{/if}
|
|
100
|
+
</button>
|
|
101
|
+
<a
|
|
102
|
+
href="https://svgrid.com/docs"
|
|
103
|
+
target="_blank"
|
|
104
|
+
rel="noopener"
|
|
105
|
+
class="rounded-lg border px-3 py-1.5 text-sm font-medium"
|
|
106
|
+
style="border-color: var(--app-border); color: var(--app-fg);">Docs</a
|
|
107
|
+
>
|
|
108
|
+
</div>
|
|
109
|
+
</header>
|
|
110
|
+
|
|
111
|
+
<main class="min-w-0 flex-1 p-6">
|
|
112
|
+
{@render children()}
|
|
113
|
+
</main>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
@@ -1,21 +1,32 @@
|
|
|
1
|
-
# SvGrid app
|
|
2
|
-
|
|
3
|
-
A minimal [Vite](https://vite.dev) + [Svelte 5](https://svelte.dev) app wired
|
|
4
|
-
to [SvGrid](https://
|
|
5
|
-
|
|
6
|
-
```bash
|
|
7
|
-
npm install
|
|
8
|
-
npm run dev # http://localhost:5173
|
|
9
|
-
npm run build
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
Open `src/App.svelte` and edit the `rows` / `columns` to use your own data.
|
|
13
|
-
|
|
14
|
-
## Next steps
|
|
15
|
-
|
|
16
|
-
- Add more features: `rowExpandingFeature`, `columnGroupingFeature`, pagination, pinned rows. See the [docs](https://
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
# SvGrid app
|
|
2
|
+
|
|
3
|
+
A minimal [Vite](https://vite.dev) + [Svelte 5](https://svelte.dev) app wired
|
|
4
|
+
to [SvGrid](https://svgrid.com), the Svelte 5 data grid and data table.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npm install
|
|
8
|
+
npm run dev # http://localhost:5173
|
|
9
|
+
npm run build
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Open `src/App.svelte` and edit the `rows` / `columns` to use your own data.
|
|
13
|
+
|
|
14
|
+
## Next steps
|
|
15
|
+
|
|
16
|
+
- Add more features: `rowExpandingFeature`, `columnGroupingFeature`, pagination, pinned rows. See the [docs](https://svgrid.com/docs/).
|
|
17
|
+
- Browse [370+ live demos](https://svgrid.com/demos/) for copy-paste recipes.
|
|
18
|
+
- Need Excel/PDF export, import, print, or pivot tables? Add [`@svgrid/enterprise`](https://svgrid.com/pricing/).
|
|
19
|
+
- Want a full app shell with routing? Scaffold the admin starter instead:
|
|
20
|
+
`npm create @svgrid@latest my-admin -- --template admin-dashboard`
|
|
21
|
+
|
|
22
|
+
## Working with an AI assistant
|
|
23
|
+
|
|
24
|
+
Point it at the SvGrid MCP server so it writes against the real API instead of
|
|
25
|
+
guessing:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
claude mcp add svgrid -- npx -y @svgrid/mcp
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Built with [SvGrid](https://svgrid.com). SvGrid(TM) is a trademark of
|
|
32
|
+
jQWidgets Ltd. This template is MIT-licensed.
|