Minimal Sortable HTML Table In Vue – sorted-table


sorted-table is a Vue.js component that applies a basic Sortable functionality to the HTML table.

Basic Usage:

1. Install and import the sorted-table component.

import SortedTablePlugin from "vue-sorted-table";

2. Register the component.


3. Create a sortable table in your template.

  <div id="app">
    <sorted-table :values="values">
          <th scope="col" style="text-align: left; width: 10rem;">
            <sort-link name="id">ID</sort-link>
          <th scope="col" style="text-align: left; width: 10rem;">
            <sort-link name="name">Name</sort-link>
          <th scope="col" style="text-align: left; width: 10rem;">
            <sort-link name="hits">Hits</sort-link>
      <template #body="sort">
          <tr v-for="value in sort.values" :key="">
            <td>{{ }}</td>
            <td>{{ }}</td>
            <td>{{ value.hits }}</td>

4. Populate the HTML table.

export default {
  name: "App",
  data: function() {
    return {
      values: [
        { name: "Plugin Foo", id: 2, hits: 33 },
        { name: "Plugin Bar", id: 1, hits: 42 },
        { name: "Plugin Foo Bar", id: 3, hits: 79 }

5. Customize the sorting icons.

  ascIcon: 'asc icon here',
  descIcon: 'desc icon here'

Download Details:

Author: BernhardtD

Live Demo:

Download Link:

Official Website:

Last Update: December 2, 2019


# NPM 
$ npm install vue-sorted-table --save

You Might Be Interested In:

Add Comment