Powerful Vue 3 Data Grid component built on top of RevoGrid.
Support Millions of cells and thousands of columns easy and efficiently for fast data rendering. Easy to use.
Demo and API •
Key Features •
How To Use •
Installation •
Docs •
License
RevoGrid material theme.
Key Features
-
High Performance: Handles millions of cells in the viewport with a powerful core built by default.
-
Accessibility: Follows WAI-ARIA best practices.
-
Keyboard Support:
- Excel-like focus for efficient navigation and editing.
- Seamless copy/paste from Excel, Google Sheets, or any other sheet format.
-
Lightweight: Minimal initial bundle size . Can be imported with polyfills or as a module for modern browsers.
-
Intelligent Virtual DOM: Smart row recombination to minimize redraws.
-
Virtual Scroll: Handles large datasets with infinite scroll.
-
Drag and Drop: Drag and drop in rows and columns.
-
Sorting: Multiple options, customizable per column, with advanced event handling.
-
Filtering:
- Predefined system filters.
- Multi column filters.
- Conditional filters.
- Preserve existing collections.
- Custom filters to extend system filters with your own set.
-
Export: Export data to file.
-
Custom Sizes: Define custom sizes for columns and rows. Automatic sizing based on content.
-
Column Resizing: Adjust column widths.
-
Pinned/Sticky/Freezed Elements:
- Columns (define left or right).
- Rows (define top or bottom).
-
Grouping:
-
Column Types: More details
-
Range Operations:
-
Theme Packages:
- Excel-like (default).
- Material (compact, dark, or light).
-
Extensibility: Modern VNode features and tsx support for easy extension.
-
Trimmed Rows: Hide rows on demand.
-
Plugin System: Create custom plugins or extend existing ones easily.
-
Formula Support: Evaluate formulas in cell data.
-
Master Detail/Subtables/Forms: Expand rows to reveal child data.
-
Cell/Column/Row Span/Merge: Merge cells to form groups.
-
Customizations:
⚠️ Note: Repository Notice: This repo is read-only. Create new issues at the revogrid repo
-
Cell template (create your own cell views).
-
Cell editor (use predefined or apply your own custom editors and cell types).
-
Rich API & Additional Improvements: Explore hundreds of other small customizations and improvements in RevoGrid.
Usage Vue 3
[!TIP]
For Vue 2, use this repo
With NPM:
npm i @revolist/vue3-datagrid --save;
With Yarn:
yarn add @revolist/vue3-datagrid;
// App.vue
<template>
<Grid
:editors="gridEditors"
:source="source"
:columns="columns"
@cell-custom-action="testCustomCellAction"
@cell-click="testAction"
/>
</template>
<script lang="ts" setup>
/**
* This is an example of a Vue3 component using Revogrid
*/
import { provide, readonly, ref } from 'vue';
/**
* Import Revogrid, Renderer and Editor for Vue
*/
import Grid, { VGridVueEditor, VGridVueTemplate, Editors } from '@revolist/vue3-datagrid';
import Editor from './Editor.vue';
import Cell from './Cell.vue';
const count = ref(0)
provide('read-only-count', readonly(count));
const MY_EDITOR = 'custom-editor';
// Vue column editor register
const gridEditors: Editors = { [MY_EDITOR]: VGridVueEditor(Editor) };
// Define columns
const columns = [
{
prop: 'name',
name: 'First',
// editor type
editor: MY_EDITOR,
// vue cell component register
cellTemplate: VGridVueTemplate(Cell),
},
{
prop: 'details',
name: 'Second',
},
];
// Define source
const source = [
{
name: '1',
details: 'Item 1',
},
{
name: '2',
details: 'Item 2',
},
];
// For testing events
function testCustomCellAction(e: CustomEvent) {
console.log('Custom cell action', e);
}
function testAction(e: CustomEvent) {
console.log('Editor action', e);
}
</script>
// Cell.vue
<template>
<div ref="cell" @click="customCellClickEvent">{{ rowIndex }}</div>
</template>
<script lang="ts" setup>
import { defineProps, ref, inject } from 'vue';
import type { ColumnDataSchemaModel } from '@revolist/vue3-datagrid';
const props = defineProps<ColumnDataSchemaModel>();
const cell = ref<HTMLElement>();
const message = inject('sample');
function customCellClickEvent() {
console.log('Custom cell click > Injected message:', message);
const event = new CustomEvent('cell-custom-action', {
bubbles: true,
detail: { row: props.model },
});
cell.value?.dispatchEvent(event);
}
</script>
// Editor.vue
<template>
<button @click="onBtn">Finish edit</button>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
props: ['rowIndex', 'model', 'save', 'close'],
methods: {
onBtn(e: MouseEvent) {
// create and dispatch event
const event = new CustomEvent('cell', {
bubbles: true,
detail: { row: this.model },
});
this.$el.dispatchEvent(event);
e.stopPropagation();
if (typeof this.close === 'function') {
(this.close as () => void)();
}
},
},
});
</script>
Example and guide
Versions
-
2.0+: Introduced the plugin system, grouping, sorting, and filtering.
-
3.0+: Breaking changes introduced:
- Removed the redundant viewport component.
- Renamed classes to support Bootstrap and other libraries:
row
-> rgRow
col
-> rgCol
data-cell
-> rgCell
data-header-cell
-> rgHeaderCell
- Migrated all method names to lowercase to align with modern event naming conventions. For example,
afterEdit
is now afteredit
. Check the API for details. - Added support for pure ESM modules to enable the use of the grid in all modern frontend tooling like Vite, Parcel, etc. You can now import custom elements without lazy loading. Note that you are responsible for polyfills.
-
4.0+: Breaking changes introduced. See the migration guide.
-
Redesigned type support:
- Removed deprecated namespaces:
- Before: RevoGrid.ColumnRegular
- Now: ColumnRegular
;
- Improved type import:
- Before: import { RevoGrid } from '@revolist/revogrid/dist/types/interfaces'
- Now: import { ColumnRegular } from '@revolist/revogrid'
.
- Changed viewport type names everywhere. For example, before: rowDefinitions: [{ type: "row", index: 0, size: 145 }]
, after: rowDefinitions: [{ type: "rgRow", index: 0, size: 145 }]
.
- Updated event naming convention. Review your event usage. Event names are all lowercase now and are aligned with modern event naming conventions. For example,
afterEdit
-> afteredit
. - Multiple event breaking changes introduced: beforerowrender now returns
BeforeRowRenderEvent
. Check all events for details.
-
Major improvements:
- Rethought the entire framework approach. Introduced Pro version with advance support and pro features.
- Introduced slot support.
- Updated scrolling system for better mobile support.
- Advance template support. Introduced
additionalData
for templates and editors. Prop
gives access to parent/root app context. - Redesigned the documentation.
- Fixed major issues and significantly improved overall performance, making the grid multiple time faster.
- Enhanced plugin support - now with full access to grid providers.
- Updated documentation.
- Provided full framework support and native render for Angular, React, Svelte and Vue.
-
What next?
We would like to extend our heartfelt gratitude to our sponsors for their generous support. Their contributions help us maintain and develop RevoGrid.
If you or your company would like to support the ongoing development of RevoGrid, please consider or use a Pro version. Your support will help us continue to improve the project and provide the best possible tool for the community.
Thank you for supporting RevoGrid! 🙏
Contributing
By getting involved, you'll have the opportunity to enhance your skills, gain valuable experience, and make a significant impact on an innovative project. Your contribution, no matter how big or small, is valuable.
Why Contribute?
- Expand Your Knowledge: Working on complex libraries allows you to dive deep into modern web technologies, improve your coding skills, and learn best practices in performance optimization, data handling, and component-based architecture.
- Experience: Contributing to an open-source project like provides you with practical experience that can be a great addition to your portfolio. It demonstrates your ability to work collaboratively, solve complex problems, and contribute to a project's success.
- Professional Growth: By contributing, you become part of a network of talented developers. This can lead to mentorship opportunities, collaborations, and professional connections that can benefit your career.
License
MIT