Skip to main content

Svelte

A Svelte wrapper component for Grid.js.

Installation

npm install gridjs gridjs-svelte

GitHub

Usage

Try it out in the browser

<script>
import Grid from "gridjs-svelte"

const data = [
{ name: "John", email: "john@example.com" },
{ name: "Mark", email: "mark@gmail.com" },
]
</script>

<Grid data={data} />

<style global>
@import "https://cdn.jsdelivr.net/npm/gridjs/dist/theme/mermaid.min.css";
</style>

There is also an example server side.

You can pass all Grid.js configs, refer to Grid.js documentation for specific configuration options.

How to get instance?

You can use instance and bind it with state, see how to bindings component