All Projects → vincjo → Svelte Simple Datatables

vincjo / Svelte Simple Datatables

Licence: mit
A Datatable component for Svelte

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Svelte Simple Datatables

Datatablesbundle
This Bundle integrates the jQuery DataTables plugin into your Symfony application.
Stars: ✭ 334 (+496.43%)
Mutual labels:  table, datatables, datatable
Vue Data Tables
A simple, customizable and pageable table with SSR support, based on vue2 and element-ui
Stars: ✭ 976 (+1642.86%)
Mutual labels:  table, datatables, datatable
Vanilla Datatables
A lightweight, dependency-free javascript HTML table plugin
Stars: ✭ 314 (+460.71%)
Mutual labels:  table, datatable
Bunny
BunnyJS - Lightweight native (vanilla) JavaScript (JS) and ECMAScript 6 (ES6) browser library, package of small stand-alone components without dependencies: FormData, upload, image preview, HTML5 validation, Autocomplete, Dropdown, Calendar, Datepicker, Ajax, Datatable, Pagination, URL, Template engine, Element positioning, smooth scrolling, routing, inversion of control and more. Simple syntax and architecture. Next generation jQuery and front-end framework. Documentation and examples available.
Stars: ✭ 473 (+744.64%)
Mutual labels:  datatables, datatable
Tables
Bulma themed, VueJS powered Datatable with server-side loading and JSON template setup
Stars: ✭ 575 (+926.79%)
Mutual labels:  demo, datatable
ng-mazdik
Angular UI component library
Stars: ✭ 86 (+53.57%)
Mutual labels:  table, datatable
Material Table
Datatable for React based on material-ui's table with additional features
Stars: ✭ 3,198 (+5610.71%)
Mutual labels:  table, datatable
Ngx Datatable
✨ A feature-rich yet lightweight data-table crafted for Angular
Stars: ✭ 4,415 (+7783.93%)
Mutual labels:  table, datatable
Ce
Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software.
Stars: ✭ 5,832 (+10314.29%)
Mutual labels:  table, datatables
Tablesaw
A group of plugins for responsive tables.
Stars: ✭ 5,497 (+9716.07%)
Mutual labels:  table, datatables
Vue Handsontable Official
Vue Data Grid with Spreadsheet Look & Feel. Official Vue wrapper for Handsontable.
Stars: ✭ 751 (+1241.07%)
Mutual labels:  table, datatable
bwt-datatable
Data table with Polymer 3 support!
Stars: ✭ 43 (-23.21%)
Mutual labels:  table, datatable
svelte-generic-crud-table
Agnostic web-component for object-arrays with CRUD functionality.
Stars: ✭ 38 (-32.14%)
Mutual labels:  table, svelte
Reactgrid
Add spreadsheet-like behavior to your React app
Stars: ✭ 289 (+416.07%)
Mutual labels:  table, datatable
ag-grid
The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.
Stars: ✭ 8,743 (+15512.5%)
Mutual labels:  table, datatable
jQuery-datatable-server-side-net-core
A simple Visual Studio solution using jQuery DataTable with Server-Side processing using .NET 5
Stars: ✭ 71 (+26.79%)
Mutual labels:  datatables, datatable
ant-table-extensions
Export, Search extensions to Ant Design's Table component.
Stars: ✭ 43 (-23.21%)
Mutual labels:  datatables, table
vue-data-table
Smart table using vue.js - sorting columns, filter by string, child rows, custom columns, custom row data
Stars: ✭ 15 (-73.21%)
Mutual labels:  datatables, table
Datatable
A simple, modern and interactive datatable library for the web
Stars: ✭ 587 (+948.21%)
Mutual labels:  table, datatable
Vue2 Datatable
The best Datatable for Vue.js 2.x which never sucks. Give us a star 🌟 if you like it! (DEPRECATED. As I, @kenberkeley, the only maintainer, no longer works for OneWay. Bugs may be fixed but new features or breaking changes might not be merged. However, it's still the best in my mind because of its extremely flexible usage of dynamic components)
Stars: ✭ 867 (+1448.21%)
Mutual labels:  table, datatable
logo

svelte-simple-datatables

npm version last commit

Presentation

Datatable component default behavior :

  • Fits in its container
  • The table has fixed header
  • Scrolls vertically and horizontally
  • Responsive design

👉 Live Demo

Todos :

  • Sort columns programmatically
  • Server side data

Install

✅ Install as a dev dependency if using Sapper to avoid a SSR error.

npm i -D svelte-simple-datatables

Sample code

To enable the filter and sort functions, you have to specify the data-key in the <th> tag. You can set an expression in plain javascript.
Settings definition is optionnal.

<script>
    import { data } from './data.example.js'  
    import { Datatable, rows } from 'svelte-simple-datatables'

    const settings = {
        sortable: true,
        pagination: true,
        rowPerPage: 50,
        columnFilter: true,
    }
</script>

<Datatable settings={settings} data={data}>
    <thead>
        <th data-key="id">ID</th>
        <th data-key="first_name">First Name</th>
        <th data-key="last_name">Last Name</th>
        <th data-key="email">Email</th>
        <th data-key="ip_address">IP Adress</th>
    </thead>
    <tbody>
    {#each $rows as row}
        <tr>
            <td>{row.id}</td>
            <td>{row.first_name}</td>
            <td>{row.last_name}</td>
            <td>{row.email}</td>
            <td>{row.ip_address}</td>
        </tr>
    {/each}
    </tbody>
</Datatable>

See demo here

i18n

Labels can be defined in the settings :

const settings = {
    labels: {
        search: 'Search...',    // search input placeholer
        filter: 'Filter',       // filter inputs placeholder
        noRows: 'No entries to found',
        info: 'Showing {start} to {end} of {rows} entries',
        previous: 'Previous',
        next: 'Next',       
    }
}

See demo here

Optional blocks

The Datatable includes 3 optional blocks

  • PaginationButtons
  • PaginationRowCount
  • SearchInput

These can be disabled in the settings, imported as components and placed anywhere :

<script>
    import { data } from './data.example.js' 
    import { SearchInput, PaginationButtons, PaginationRowCount, Datatable, rows } from 'svelte-simple-datatables'

    const settings = {
        blocks: {
            searchInput: false, 
            paginationButtons: false,
            paginationRowCount: false,
        }
    }
</script>

<SearchInput/>
<PaginationButtons/>
<PaginationRowCount/>

<Datatable {settings} {data}>
    (...)
</Datatable>

See demo here

Use of expressions in key dataset

<script>
    import { data } from './data.example.js'  
    import { Datatable, rows } from 'svelte-simple-datatables'
</script>

<Datatable {data}>
    <thead>
        <th data-key="id">ID</th>

        <!-- Function that will be used for sorting and filtering -->
        <th data-key="(row) => row.first_name + ' ' + row.last_name">User</th>

        <th data-key="email">Email</th>
        <th data-key="ip_address">IP Adress</th>
    </thead>
    <tbody>
    {#each $rows as row}
        <tr>
            <td>{row.id}</td>

            <!-- This allows for example to concatenate values -->
            <td>{row.first_name} {row.last_name}</td>

            <td>{row.email}</td>
            <td>{row.ip_address}</td>
        </tr>
    {/each}
    </tbody>
</Datatable>

See demo here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].