Skip to content

Getting started ​

v-table-system is a data table. It comes in two forms:

Both have the same features and the same options.

Install ​

bash
npm install v-table-system

Vue 3.4 or newer is required for the Vue component. The styles are included, there is no CSS file to import.

Your first table ​

Give the table its columns and its data. With clientSide the table sorts, searches and paginates the array by itself.

vue
<template>
  <VTable :columns="columns" :data="products" clientSide :itemsPerPage="5" />
</template>

<script setup lang="ts">
import { VTable, type Column } from "v-table-system";
import { products } from "./data";

const columns: Column[] = [
  { key: "id", label: "ID" },
  { key: "name", label: "Name" },
  { key: "category", label: "Category" },
  { key: "price", label: "Price" },
];
</script>

The examples in this guide all use the same list of 48 products:

ts
export interface Product {
  id: number;
  name: string;
  category: string;
  price: number;
  stock: number;
  status: "active" | "draft";
}

const names = ["Keyboard", "Mouse", "Monitor", "Headset", "Webcam", "Laptop stand", "USB hub", "Desk lamp"];
const categories = ["Accessories", "Displays", "Audio", "Office"];

// 48 products, always the same so the examples are easy to follow
export const products: Product[] = Array.from({ length: 48 }, (_, i) => ({
  id: i + 1,
  name: `${names[i % names.length]} ${Math.floor(i / names.length) + 1}`,
  category: categories[(i * 3) % categories.length],
  price: 15 + ((i * 37) % 180),
  stock: (i * 11) % 60,
  status: i % 4 === 0 ? "draft" : "active",
}));

Client-side and server-side data ​

Client-sideServer-side
HowAdd the clientSide propLeave clientSide out
data holdsEvery rowOnly the rows of the current page
Search, sort, pagingDone by the tableDone by your API, the table emits events
Good forData already loaded in the browserLarge or remote data

Most pages of this guide use clientSide to keep the examples short. Server-side data shows the other way.

Next steps ​

Released under the Apache-2.0 License.