Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website with demo table using shadcn-svelte #8

Merged
merged 3 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Lint and svelte-check
- name: svelte-check
run: npm run check

- name: Unit tests
run: npm test
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
engine-strict=true
legacy-peer-deps=true
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
<h1 align="center">@careswitch/svelte-data-table</h1>
<h1 align="center">svelte-data-table</h1>

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

- No dependencies
- TypeScript
- SvelteKit, SSR, and Svelte 5 Runes
- Supports SvelteKit, SSR, Svelte 5

## Quickstart
## Installation

`npm install @careswitch/svelte-data-table`
```bash
npm install @careswitch/svelte-data-table
```

## Usage

```svelte
<script lang="ts">
import { DataTable } from '@careswitch/svelte-data-table';

const table = new DataTable({
data: [
{ id: 1, name: 'John Doe', status: 'active' },
{ id: 2, name: 'Jane Doe', status: 'inactive' }
],
columns: [
{ key: 'id', name: 'ID' },
{ key: 'name', name: 'Name' },
{ key: 'status', name: 'Status', sortable: false }
]
});
</script>
```
14 changes: 14 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "new-york",
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app.css",
"baseColor": "zinc"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils"
},
"typescript": true
}
Loading