DataGrid.svelte
A basic svelte datagrid component with some advanced features (sort, filter, events)
Demo
Here is a live demo:
https://bassem-essam.github.io/DataGrid.svelte/
Features
- Advanced filtering options using javascript code
- Sortable data
- Ability to add event handlers (on:rowClick, on:rowDoubleClick, on:cellClick, on:headCellClick)
Usage
- clone this repository
- copy the entire datagrid folder into your svelte project under /lib directory probably
- import DataGrid component and use it directly
Learning Outcomes
- How to make a minimal event system
- svelte/store is the best
TODOs
- Add typescript (or at least make events
- Refactor the code
Advice
Use TanStack or something similar to build your datagrid component as I guess it may offer customizability and good features out of the box.
License
This code is your responsibility now