• Stars
    star
    473
  • Rank 92,832 (Top 2 %)
  • Language
    TypeScript
  • Created over 2 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unopinionated and extensible data tables for Svelte

svelte-headless-table

Svelte Headless Table

npm version npm downloads license build

Unopinionated and extensible data tables for Svelte

Build and design powerful datagrid experiences while retaining 100% control over styles and markup.

Visit the documentation for code examples and API reference, and get started with the quick start guide!

Why Svelte Headless Table?

Svelte Headless Table is designed to work seamlessly with Svelte. If you love Svelte, you will love Svelte Headless Table.

  • Full TypeScript support
  • Compatible with SvelteKit and SSR
  • Manage state with Svelte stores
  • Headless and fully customizable
  • Intuitive column-first declarative model
  • Highly performant
  • Feature-rich

All the features you could ever need!

Svelte Headless Table comes with an extensive suite of plugins.

Easily extend Svelte Headless Table with complex sorting, filtering, grouping, pagination, and much more.

Plugin roadmap

Examples

<script>
  const data = readable([
    { name: 'Ada Lovelace', age: 21 },
    { name: 'Barbara Liskov', age: 52 },
    { name: 'Richard Hamming', age: 38 },
  ]);

  const table = createTable(data);

  const columns = table.createColumns([
    table.column({
      header: 'Name',
      accessor: 'name',
    }),
    table.column({
      header: 'Age',
      accessor: 'age',
    }),
  ]);

  const {
    headerRows,
    rows,
    tableAttrs,
    tableBodyAttrs,
  } = table.createViewModel(columns);
</script>

<table {...$tableAttrs}>
  <thead>
    {#each $headerRows as headerRow (headerRow.id)}
      <Subscribe rowAttrs={headerRow.attrs()} let:rowAttrs>
        <tr {...rowAttrs}>
          {#each headerRow.cells as cell (cell.id)}
            <Subscribe attrs={cell.attrs()} let:attrs>
              <th {...attrs}>
                <Render of={cell.render()} />
              </th>
            </Subscribe>
          {/each}
        </tr>
      </Subscribe>
    {/each}
  </thead>
  <tbody {...$tableBodyAttrs}>
    {#each $rows as row (row.id)}
      <Subscribe rowAttrs={row.attrs()} let:rowAttrs>
        <tr {...rowAttrs}>
          {#each row.cells as cell (cell.id)}
            <Subscribe attrs={cell.attrs()} let:attrs>
              <td {...attrs}>
                <Render of={cell.render()} />
              </td>
            </Subscribe>
          {/each}
        </tr>
      </Subscribe>
    {/each}
  </tbody>
</table>

For more complex examples with advanced features, visit the documentation site.

More Repositories

1

svelte-popperjs

Popper for Svelte with actions, no wrapper components required!
TypeScript
113
star
2

svelte-previous

A Svelte store that remembers previous values
TypeScript
82
star
3

svelte-keyed

A writable derived store for objects and arrays
TypeScript
69
star
4

svelte-render

Manage complex Svelte behaviors outside of templates with full type safety.
TypeScript
25
star
5

vim-colorscheme-icons

Colorize vim-devicons with the current colorscheme
Vim Script
20
star
6

tailwindcss-global-dark

A TailwindCSS variant for class-based dark mode with CSS Modules.
JavaScript
17
star
7

zoo-ids

Generate predictable and unique identifiers composed of adjectives and animal names
TypeScript
15
star
8

svelte-subscribe

Subscribe to non top-level stores in your Svelte template
TypeScript
13
star
9

godot-multiplayer

A minimal Godot project with cross-platform authentication and matchmaking
GDScript
6
star
10

meetwhen-ui

A simple group scheduling application!
TypeScript
6
star
11

perfect-clear

A browser-based interactive Tetris Perfect Clear solver
Rust
5
star
12

bryanmylee.com

My personal website
Svelte
3
star
13

sequence-crdt

A C library to manage CRDT text documents efficiently
C
3
star
14

dotfiles

My system configuration
Shell
3
star
15

simple-extension

A simple cross-browser extension with Svelte as the popup controller.
JavaScript
2
star
16

tailwindcss-extrude

Extrude your elements for a retro look!
JavaScript
2
star
17

svelte-headless-table.bryanmylee.com

Svelte
2
star
18

wavefocus

The monorepo for all Wave Focus related projects
TypeScript
2
star
19

tex-er-diagram

A LaTeX package for drawing ER diagrams
TeX
1
star
20

vite-svelte-library-mode

Svelte
1
star
21

svelte-testing-library-no-events

TypeScript
1
star
22

meetwhen-service

A serverless REST API and authentication service built on Cloud Firestore for meetwhen.io
TypeScript
1
star
23

astro-dot-notation-components

Astro
1
star
24

meetwhen-store

The data store for all meetwhen.io events.
TypeScript
1
star
25

vitest-await-crashes

TypeScript
1
star
26

learning-godot-3d

Learning some basic Godot 3D
GDScript
1
star
27

meetwhen-telegram

A Telegram bot to help you schedule your group meetings!
TypeScript
1
star