1. API Reference
  2. createTable

API Reference

createTable

Every Svelte Headless Table starts with createTable. It takes a data source and plugin configuration, and returns a Table instance.

Usage


createTable: (data, plugins) => Table

data is a Svelte store containing an array of data to present on the table. If data needs to be updated (e.g. when editing the table or lazy-fetching data from the server), use a Writable store.

plugins is an object of plugin names to plugins. Refer to the plugin system on how to use Svelte Headless Table plugins.

const table = createTable(data, {
  sort: addSortBy(),
  filter: addColumnFilters(),
});