Skip to content

Commit 3b62750

Browse files
committed
Update README
1 parent febbf72 commit 3b62750

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

README.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
<h1 align="center">svelte-data-table</h1>
1+
<img align="center" alt="Svelte Data Table Screenshot" src="https://github.com/user-attachments/assets/fc527332-882b-463a-b070-d4714b32ec47">
22

3-
<p align="center">Small, fast data table library with client-side sorting, filtering, and pagination.</p>
3+
---
44

55
- No dependencies
66
- TypeScript
77
- Supports SvelteKit, SSR, Svelte 5
8+
- Works great with shadcn [Data Table](https://www.shadcn-svelte.com/docs/components/data-table)
9+
10+
## Demo
11+
12+
**[Demo Website](https://careswitch-svelte-data-table.vercel.app)**
813

914
## Installation
1015

1116
```bash
1217
npm install @careswitch/svelte-data-table
1318
```
1419

20+
_Requires Svelte 5 peer dependency_
21+
1522
## Usage
1623

1724
```svelte
@@ -26,8 +33,31 @@ npm install @careswitch/svelte-data-table
2633
columns: [
2734
{ key: 'id', name: 'ID' },
2835
{ key: 'name', name: 'Name' },
29-
{ key: 'status', name: 'Status', sortable: false }
36+
{ key: 'status', name: 'Status' }
3037
]
3138
});
3239
</script>
40+
41+
<table>
42+
<thead>
43+
<tr>
44+
{#each table.columns as column (column.key)}
45+
<th>{column.name}</th>
46+
{/each}
47+
</tr>
48+
</thead>
49+
<tbody>
50+
{#each table.rows as row (row.id)}
51+
<tr>
52+
{#each table.columns as column (column.key)}
53+
<td>{row[column.key]}</td>
54+
{/each}
55+
</tr>
56+
{/each}
57+
</tbody>
58+
</table>
3359
```
60+
61+
## Examples
62+
63+
Reference the demo website [+page.svelte](./src/routes/+page.svelte) for a more comprehensive example.

0 commit comments

Comments
 (0)