npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-data-tabulator

v1.0.3

Published

Light weight data tables component for Vue2 & Vue3

Downloads

31

Readme

data-tabulator

This is a light weight and customizable data table component for Vue2 and Vue3 projects. Primary Features:

  • Renders data sets as html table
  • Easily supports nested data structures with dot-notation
  • Easy content customization with per-column slots
  • Column sorting (highly customizable)

Note that only minimal CSS is provided at the moment. You will want to provide your own styles via the table-class prop.

Installation

Via NPM

Vue 3

npm install vue-data-tabulator

Vue 2

npm install vue-data-tabulator@^0.2.4

Adding the component to your project

Global install

import DataTabulator from 'vue-data-tabulator'
Vue.use(DataTabulator)

Options API:

import { DataTabulator } from 'vue-data-tabulator'
// OR, if you're using a bundler like Webpack then importing the SFC directly is more optimal:
import DataTabulator from 'vue-data-tabulator/src/DataTabulator'

export default {
    component: {DataTabulator}
}

Basic usage

CSS - optional basic styling to get you started. See also: "table-class" prop

// in a Single File Component you may add:
<style src="vue-data-tabulator/dist/vue-data-tabulator.css"></style>

Component usage:

<data-tabulator
    :data="myData"
    table-class="my-table-css-class">
</data-tabulator>

The table-class prop can be used for table styling. For example, if you are using bootstrap, this could be "table table-hover"

Custom Layouts

Customizing table cells via slots

The simplest way to customize your table is using slots to modify the markup of the table:

myData = [
    {id: 1, first: 'Matt', last: 'April', is_cool: true},
    {id: 1, first: 'John', last: 'Doe', is_cool: false},
];

Here we will convert boolean values to text for each row in the table Inside the data-tabulator component we will define a slot for the "Is_cool" column. Note that by default data-tabulator capitalizes all column names, and the slot references the case-sensitive title of the column, not the property name. So slot="Is_cool" (not is_cool). More on this below..

<data-tabulator
    :data="myData">
    
    <template v-slot:Is_cool="{row}">
        {{row.is_cool ? 'Awe Ye' : 'Heck Naw'}}    
    </template>
    
</data-tabulator>

Custom column definitions

By default the columns names of your table will match each property in your array of data, with the first letter capitalized. For example, in the myData array above, the columns would be: Id, First, Last, Is_cool. If we want the table to simple have two columns: "Name" (combination of first and last) and "Cool?", we can provide a column-override definition via props.

columns = {
   'Name': null, //set this as null because we will populate with a custom value via slots.
   'Cool?': 'is_cool' // maps is_cool property to a column titled "Cool?"
}

To populate the "Name" column we can create a template for it, referencing the title of the column we provided. Now each row in this column will display the first and last names.

<data-tabulator
    :data="myData"
    :column-override="columns">
    
    <!-- Here we define the data displayed in "Name" column -->
    <template v-slot:Name="{row}">
        {{row.first}} {{row.last}}    
    </template>
    
</data-tabulator>

_NOTE: since Vue 3 changed the syntax for slots, columns with spaces (and some other characters) required dynamic slots to be customized. v-slot:[variableName]="{row}"

Nested data structures

Data-tabulator also supports nested data structures. This can be a very useful to avoid re-structuring your data just to display it. Lets run through an example:

myData = [
    {id: 1, first: 'Matt', last: 'April', is_cool: true, employer: {
            company: 'My Space',
            since: '2001-01-01'
        }
    },
    {id: 1, first: 'John', last: 'Doe', is_cool: false, employer: {
            company: 'ACME',
            since: '2015-01-01'
        }
    },
];
columns = {
   'First': 'first',
   'Last': 'last',
   'Employer': 'employer.name' // Creates a column "Employer" that maps to the "company" property on the employer object.
}

Note: the columns object would be set as the column-override prop on your component.

Optional props

  • table-class (String|Array|Object): set class element on the (useful for applying styles)
  • disable-sorting (Bool): turns off all sorting
  • sortable (Array): specifies which columns should be sortable (use column title exactly as it displays in table)
  • default-sort-column (String): name of column to sort by default
  • sort-values (Object): An object of functions, keyed on column name. Used to define the value a given column should be sorted on. useful when working with custom columns.
  • default-sorter (Function): default sort compare function used.
  • custom-sorters (Object): custom sort functions per column, keyed on column name (as displayed in table)