vue-good-table
An easy to use powerful data table for vuejs with advanced customizations including sorting, column filtering, pagination, grouping etc
Top Related Projects
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
A Vue.js 2.0 UI Toolkit for Web
:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin
Lightweight UI components for Vue.js based on Bulma
BootstrapVue provides one of the most comprehensive implementations of Bootstrap v4 for Vue.js. With extensive and automated WAI-ARIA accessibility markup.
🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
Quick Overview
Vue-good-table is a feature-rich data table component for Vue.js applications. It provides a powerful and flexible solution for displaying and managing tabular data with built-in sorting, filtering, pagination, and more. The library is designed to be easy to use while offering extensive customization options.
Pros
- Easy to set up and use with minimal configuration
- Comprehensive set of features including sorting, filtering, pagination, and column customization
- Responsive design with mobile-friendly options
- Extensive documentation and active community support
Cons
- May be overkill for simple table needs
- Learning curve for advanced customization
- Limited built-in theming options
- Performance may degrade with very large datasets
Code Examples
- Basic table setup:
<template>
<vue-good-table
:columns="columns"
:rows="rows"
/>
</template>
<script>
import { VueGoodTable } from 'vue-good-table-next';
export default {
components: {
VueGoodTable,
},
data() {
return {
columns: [
{ label: 'Name', field: 'name' },
{ label: 'Age', field: 'age', type: 'number' },
],
rows: [
{ name: 'John', age: 30 },
{ name: 'Jane', age: 28 },
],
};
},
};
</script>
- Adding pagination:
<template>
<vue-good-table
:columns="columns"
:rows="rows"
:pagination-options="{
enabled: true,
perPage: 10
}"
/>
</template>
- Implementing custom column slots:
<template>
<vue-good-table :columns="columns" :rows="rows">
<template #table-row="props">
<span v-if="props.column.field == 'action'">
<button @click="onActionClick(props.row)">Edit</button>
</span>
<span v-else>
{{ props.formattedRow[props.column.field] }}
</span>
</template>
</vue-good-table>
</template>
Getting Started
-
Install the package:
npm install vue-good-table-next
-
Import and use the component in your Vue file:
<template> <vue-good-table :columns="columns" :rows="rows" /> </template> <script> import { VueGoodTable } from 'vue-good-table-next'; import 'vue-good-table-next/dist/vue-good-table-next.css'; export default { components: { VueGoodTable, }, data() { return { columns: [ { label: 'Name', field: 'name' }, { label: 'Age', field: 'age', type: 'number' }, ], rows: [ { name: 'John', age: 30 }, { name: 'Jane', age: 28 }, ], }; }, }; </script>
Competitor Comparisons
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
Pros of Vue
- Comprehensive framework for building entire web applications
- Larger ecosystem with more plugins, tools, and community support
- More flexible and suitable for complex, large-scale projects
Cons of Vue
- Steeper learning curve for beginners
- Potentially overkill for simple projects or single components
- Requires more setup and configuration
Code Comparison
Vue (basic component):
<template>
<div>{{ message }}</div>
</template>
<script>
export default {
data() {
return {
message: 'Hello Vue!'
}
}
}
</script>
vue-good-table (basic table):
<template>
<vue-good-table
:columns="columns"
:rows="rows"/>
</template>
<script>
export default {
data() {
return {
columns: [
{ label: 'Name', field: 'name' },
{ label: 'Age', field: 'age', type: 'number' },
],
rows: [
{ name: 'John', age: 30 },
{ name: 'Jane', age: 28 },
]
}
}
}
</script>
Vue is a full-fledged framework for building web applications, while vue-good-table is a specific component for creating tables. Vue offers more flexibility and power for complex projects, but may be excessive for simple table needs. vue-good-table provides a quick and easy solution for tables with less setup required, but is limited to that specific use case.
A Vue.js 2.0 UI Toolkit for Web
Pros of element
- Comprehensive UI component library with a wide range of components beyond tables
- Extensive documentation and community support
- Customizable themes and internationalization support
Cons of element
- Larger bundle size due to its comprehensive nature
- Steeper learning curve for developers new to the library
- May require more configuration for simple use cases
Code Comparison
element:
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="date" label="Date" width="180"></el-table-column>
<el-table-column prop="name" label="Name" width="180"></el-table-column>
<el-table-column prop="address" label="Address"></el-table-column>
</el-table>
vue-good-table:
<vue-good-table :columns="columns" :rows="rows">
</vue-good-table>
Summary
element is a comprehensive UI library offering a wide range of components, extensive documentation, and customization options. However, it may be overkill for projects that only need a table component. vue-good-table, on the other hand, is focused solely on providing a powerful and flexible table component, making it more lightweight and easier to implement for table-specific use cases. The choice between the two depends on the project's requirements and the developer's preference for a full-featured UI library versus a specialized table component.
:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin
Pros of vue-element-admin
- Comprehensive admin panel solution with a wide range of pre-built components and features
- Extensive documentation and community support
- Includes advanced features like permission control and internationalization
Cons of vue-element-admin
- Steeper learning curve due to its complexity and extensive feature set
- May be overkill for smaller projects or those requiring only table functionality
- Larger bundle size and potential performance impact for simpler applications
Code Comparison
vue-element-admin (complex table example):
<el-table
:data="list"
v-loading="listLoading"
element-loading-text="Loading"
border
fit
highlight-current-row
>
<el-table-column align="center" label="ID" width="95">
<template slot-scope="scope">
{{ scope.$index }}
</template>
</el-table-column>
<!-- More columns... -->
</el-table>
vue-good-table (simple table example):
<vue-good-table
:columns="columns"
:rows="rows"
:pagination-options="{
enabled: true,
perPage: 10
}"
>
</vue-good-table>
vue-element-admin offers a more feature-rich and complex table implementation, while vue-good-table provides a simpler, more focused table component. The choice between them depends on the project's specific requirements and complexity.
Lightweight UI components for Vue.js based on Bulma
Pros of Buefy
- Comprehensive UI component library based on Bulma CSS framework
- Offers a wide range of components beyond tables (buttons, forms, modals, etc.)
- Active development and community support
Cons of Buefy
- Larger bundle size due to its comprehensive nature
- May require more setup and configuration for specific use cases
- Learning curve for Bulma CSS framework if not already familiar
Code Comparison
Vue-good-table:
<vue-good-table
:columns="columns"
:rows="rows"
:search-options="{
enabled: true
}"
/>
Buefy:
<b-table
:data="data"
:columns="columns"
:searchable="true"
:paginated="true"
>
</b-table>
Summary
Vue-good-table is a focused table component library, while Buefy is a comprehensive UI framework. Vue-good-table may be more suitable for projects that only need table functionality, offering a simpler implementation. Buefy provides a wider range of components and is based on Bulma, making it a good choice for projects that require a complete UI solution. The choice between the two depends on the specific needs of your project and your familiarity with the underlying frameworks.
BootstrapVue provides one of the most comprehensive implementations of Bootstrap v4 for Vue.js. With extensive and automated WAI-ARIA accessibility markup.
Pros of bootstrap-vue
- Comprehensive UI component library with a wide range of elements
- Seamless integration with Bootstrap's grid system and utility classes
- Active development and large community support
Cons of bootstrap-vue
- Larger bundle size due to the full Bootstrap framework
- Less flexibility in customizing table-specific features
- Steeper learning curve for developers unfamiliar with Bootstrap
Code Comparison
bootstrap-vue table example:
<b-table
:items="items"
:fields="fields"
striped
hover
responsive="sm"
></b-table>
vue-good-table example:
<vue-good-table
:columns="columns"
:rows="rows"
:search-options="{
enabled: true
}"
></vue-good-table>
Summary
bootstrap-vue offers a comprehensive UI toolkit with Bootstrap integration, making it suitable for larger projects requiring a consistent design system. However, it may be overkill for simpler applications or those focused primarily on table functionality.
vue-good-table, on the other hand, provides a more focused solution for creating feature-rich tables in Vue.js applications. It offers greater flexibility in table customization but lacks the broader UI component ecosystem of bootstrap-vue.
Choose bootstrap-vue for full-fledged UI development with Bootstrap, or opt for vue-good-table if you need a lightweight, table-specific solution with advanced features.
🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
Pros of ant-design-vue
- Comprehensive UI component library with a wide range of components
- Follows Ant Design specifications, providing a consistent and professional look
- Active development and large community support
Cons of ant-design-vue
- Larger bundle size due to the extensive component library
- Steeper learning curve for developers unfamiliar with Ant Design principles
- Less flexibility in customizing individual components compared to vue-good-table
Code Comparison
vue-good-table:
<vue-good-table
:columns="columns"
:rows="rows"
:search-options="{
enabled: true
}"
/>
ant-design-vue:
<a-table
:columns="columns"
:dataSource="dataSource"
:pagination="{ pageSize: 10 }"
>
<template #headerCell="{ column }">
<a-input-search placeholder="Search" @search="onSearch(column)" />
</template>
</a-table>
Summary
ant-design-vue offers a comprehensive UI library with consistent design, while vue-good-table focuses specifically on table functionality. ant-design-vue provides more components but has a larger footprint, while vue-good-table is lighter and more specialized. The choice between them depends on project requirements and whether a full UI library or a dedicated table component is needed.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Vue-good-table
An easy to use, clean and powerful data table for VueJS with essential features like sorting, column filtering, pagination and much more - xaksis.github.io/vue-good-table/
:bangbang: Vue 3 Update |
---|
@borisflesch is working on a Vue 3 compatible version of VGT . Please follow/contribute to his repository as it gets production ready: vue-good-table-next |
Installing
Install with npm:
npm install --save vue-good-table
Import globally in app:
import VueGoodTablePlugin from 'vue-good-table';
// import the styles
import 'vue-good-table/dist/vue-good-table.css'
Vue.use(VueGoodTablePlugin);
Import into your component
import { VueGoodTable } from 'vue-good-table';
// add to component
components: {
VueGoodTable,
}
Import into your component using Typescript
// add to component
components: {
'vue-good-table': require('vue-good-table').VueGoodTable,
}
Example table with grouped rows and column filters
Features
- Table Search
- Sorting
- Column Filtering
- Pagination
- Highly Customizable
- Checkbox Table
- Grouped Rows Table
- Server Powered Table
- Customizable Style and Themes
Upgrade Guide
Hey there! coming from 1.x? find the upgrade guide here
Authors
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Top Related Projects
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
A Vue.js 2.0 UI Toolkit for Web
:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin
Lightweight UI components for Vue.js based on Bulma
BootstrapVue provides one of the most comprehensive implementations of Bootstrap v4 for Vue.js. With extensive and automated WAI-ARIA accessibility markup.
🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot