univer
Univer is an open-source productivity tool dev kit helping you integrate spreadsheets, docs and slides into your applications.
Top Related Projects
JavaScript Data Grid / Data Table with a Spreadsheet Look & Feel. Works with React, Angular, and Vue. Supported by the Handsontable team ⚡
The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.
📗 SheetJS Spreadsheet Data Toolkit -- New home https://git.sheetjs.com/SheetJS/sheetjs
Excel Workbook Manager
Luckysheet upgraded to Univer
Quick Overview
Univer is an open-source, high-performance spreadsheet and document processing engine. It aims to provide a powerful and flexible solution for building web-based office applications, offering features similar to Microsoft Excel and Google Sheets but with enhanced customization and integration capabilities.
Pros
- High performance and scalability, capable of handling large datasets efficiently
- Extensive API for customization and integration into various web applications
- Cross-platform compatibility, working seamlessly across different browsers and devices
- Active development and community support
Cons
- Relatively new project, may have fewer resources and documentation compared to more established alternatives
- Learning curve for developers unfamiliar with spreadsheet engine architectures
- Limited built-in features compared to fully-fledged office suites (though this is by design for flexibility)
Code Examples
- Creating a new Univer instance:
import { Univer } from '@univerjs/core';
const univer = new Univer();
const workbook = univer.createWorkbook();
- Adding data to a sheet:
const sheet = workbook.getActiveSheet();
sheet.setCellValue('A1', 'Hello');
sheet.setCellValue('B1', 'World');
sheet.setCellValue('C1', '=A1&" "&B1');
- Applying formatting:
import { BoldPlugin } from '@univerjs/sheets-ui';
univer.registerPlugin(BoldPlugin);
sheet.getRange('A1:C1').applyStyle({ fontWeight: 'bold' });
- Rendering the spreadsheet:
import { UniverRender } from '@univerjs/engine-render';
const container = document.getElementById('spreadsheet-container');
const render = new UniverRender(univer, container);
render.render();
Getting Started
To get started with Univer, follow these steps:
-
Install Univer and its dependencies:
npm install @univerjs/core @univerjs/engine-render @univerjs/sheets-ui -
Create a basic HTML file with a container for the spreadsheet:
<div id="spreadsheet-container"></div> -
Initialize Univer and render the spreadsheet (using the code examples above):
import { Univer } from '@univerjs/core'; import { UniverRender } from '@univerjs/engine-render'; import { BoldPlugin } from '@univerjs/sheets-ui'; const univer = new Univer(); univer.registerPlugin(BoldPlugin); const workbook = univer.createWorkbook(); const sheet = workbook.getActiveSheet(); // Add data and apply formatting sheet.setCellValue('A1', 'Hello Univer!'); sheet.getRange('A1').applyStyle({ fontWeight: 'bold' }); // Render the spreadsheet const container = document.getElementById('spreadsheet-container'); const render = new UniverRender(univer, container); render.render();
This basic setup will create a simple spreadsheet with a bold "Hello Univer!" message in cell A1. From here, you can explore Univer's extensive API to add more functionality and customize the spreadsheet to your needs.
Competitor Comparisons
JavaScript Data Grid / Data Table with a Spreadsheet Look & Feel. Works with React, Angular, and Vue. Supported by the Handsontable team ⚡
Pros of Handsontable
- More mature and established project with a larger community and ecosystem
- Extensive documentation and examples available
- Supports more advanced features like data validation and custom cell types
Cons of Handsontable
- Commercial license required for many use cases
- Heavier and potentially slower for large datasets
- Less flexible for custom styling and advanced UI modifications
Code Comparison
Handsontable:
const hot = new Handsontable(container, {
data: data,
rowHeaders: true,
colHeaders: true,
filters: true,
dropdownMenu: true
});
Univer:
const univer = new Univer({
container: document.getElementById('container'),
sheet: {
row: 100,
column: 20,
data: data
}
});
Both libraries provide similar basic functionality for creating spreadsheet-like interfaces in web applications. Handsontable offers a more feature-rich experience out of the box, while Univer focuses on performance and flexibility for custom implementations.
Handsontable is better suited for projects requiring a comprehensive spreadsheet solution with minimal customization, while Univer may be preferable for developers looking to build more tailored experiences or work with larger datasets.
The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.
Pros of ag-grid
- More mature and widely adopted project with extensive documentation
- Offers both community and enterprise editions with advanced features
- Supports multiple frameworks (React, Angular, Vue) out of the box
Cons of ag-grid
- Steeper learning curve due to complex API and configuration options
- Enterprise features require a paid license, which can be costly for some projects
- Heavier bundle size compared to lighter alternatives
Code Comparison
ag-grid:
const gridOptions = {
columnDefs: [
{ field: 'make' },
{ field: 'model' },
{ field: 'price' }
],
rowData: [
{ make: 'Toyota', model: 'Celica', price: 35000 }
]
};
univer:
const workbook = new Workbook();
const sheet = workbook.createSheet('Sheet1');
sheet.setCellValue('A1', 'Make');
sheet.setCellValue('B1', 'Model');
sheet.setCellValue('C1', 'Price');
Summary
ag-grid is a powerful and feature-rich grid library with extensive support for various frameworks. It offers advanced functionality but comes with a steeper learning curve and potential licensing costs. univer, on the other hand, is a newer project focusing on spreadsheet-like functionality, which may be more suitable for specific use cases requiring Excel-like features.
📗 SheetJS Spreadsheet Data Toolkit -- New home https://git.sheetjs.com/SheetJS/sheetjs
Pros of sheetjs
- Mature and widely adopted project with extensive documentation
- Supports a vast array of spreadsheet formats and features
- Lightweight and works in both browser and Node.js environments
Cons of sheetjs
- Limited built-in UI components for spreadsheet rendering
- Requires more custom code for advanced interactive features
- Commercial use requires a paid license
Code Comparison
sheetjs:
import * as XLSX from 'xlsx';
const workbook = XLSX.utils.book_new();
const worksheet = XLSX.utils.json_to_sheet(data);
XLSX.utils.book_append_sheet(workbook, worksheet, "Sheet1");
XLSX.writeFile(workbook, "output.xlsx");
univer:
import { Univer } from '@univerjs/core';
import { UniverSheet } from '@univerjs/sheet';
const univer = new Univer();
const sheet = univer.createSheet();
sheet.setData(data);
sheet.export('xlsx', 'output.xlsx');
Key Differences
- univer focuses on providing a complete spreadsheet solution with built-in UI components
- sheetjs excels in file format support and data processing
- univer offers a more modern API and is designed for web-based spreadsheet applications
- sheetjs has a larger community and more extensive third-party integrations
Both projects have their strengths, with sheetjs being more suitable for data processing tasks and univer better suited for building interactive spreadsheet applications.
Excel Workbook Manager
Pros of ExcelJS
- More mature and widely adopted project with extensive documentation
- Supports a broader range of Excel features and file formats
- Robust API for reading, writing, and manipulating Excel files
Cons of ExcelJS
- Primarily focused on server-side Node.js usage, less suitable for browser environments
- Heavier library size compared to Univer
- Less emphasis on collaborative editing and real-time updates
Code Comparison
ExcelJS:
const workbook = new ExcelJS.Workbook();
const worksheet = workbook.addWorksheet('Sheet1');
worksheet.getCell('A1').value = 'Hello, World!';
await workbook.xlsx.writeFile('example.xlsx');
Univer:
const univer = new Univer();
const sheet = univer.createSheet();
sheet.setCellValue('A1', 'Hello, World!');
await univer.exportToExcel('example.xlsx');
Summary
ExcelJS is a more established library with comprehensive Excel file manipulation capabilities, primarily for Node.js environments. Univer, on the other hand, is a newer project focusing on browser-based spreadsheet functionality with collaborative features. ExcelJS offers broader Excel support, while Univer aims for a lighter, more modern approach to spreadsheet operations in web applications.
Luckysheet upgraded to Univer
Pros of Luckysheet
- More mature and stable project with a longer development history
- Extensive documentation and examples available
- Larger community and more third-party integrations
Cons of Luckysheet
- Limited to spreadsheet functionality
- Heavier and potentially slower for large datasets
- Less modular architecture, making customization more challenging
Code Comparison
Luckysheet:
luckysheet.create({
container: 'luckysheet',
data: [{ name: 'Sheet1', celldata: [{ r: 0, c: 0, v: 'Hello' }] }]
});
Univer:
const univer = new Univer({
container: document.getElementById('univer'),
modules: [UniverSheet],
});
univer.createSheet();
Key Differences
Univer is a newer, more modular project aimed at creating a comprehensive office suite, while Luckysheet focuses solely on spreadsheet functionality. Univer's architecture allows for easier extensibility and customization, potentially making it more suitable for complex, tailored solutions. However, Luckysheet's maturity and extensive documentation may make it a better choice for projects requiring a robust, well-established spreadsheet component.
Both projects are open-source and actively maintained, but Univer's broader scope and modular design position it as a more versatile option for developers looking to implement a full-featured office suite in their applications.
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
The Ultimate Office Suite of the Next Generation.
Extensible. High-performance. Embedded to your application.
English | ç®ä½ä¸æ | æ¥æ¬èª
Official Site | Documentation | Online Playground | Blog
Table of contents
ð Highlights
- ð Univer is designed to support spreadsheets, documents and presentation.
- âï¸ Univer is easily embeddable, allowing seamless integration into your applications.
- ð Univer is powerful, offering a wide range of features including formulas, conditional formatting, data validation, filtering, collaborative editing, printing, import & export and more features on the horizon.
- ð Univer is highly extensible, thanks to its plug-in architecture and Facade API that makes it a delight for developers to implement their unique requirements on the top of Univer.
- ð Univer is highly customizable, allowing you to personalize its appearance using themes. It also provides support for internationalization (i18n).
- â¡ Univer in performant.
- âï¸ Univer boasts an efficient rendering engine based on canvas, capable of rendering various document types flawlessly. The rendering engines supports advanced typesetting features such as punctuation squeezing, text and image layout and scroll buffering.
- ð§® Univer incorporates a lightning-fast formula engine that can operate in Web Workers or even on the server side.
- ð Univer is a highly integrated system. Documents, spreadsheets and slides can interoperate with each others and even rendered on the same canvas, allowing information and data flow within Univer.
⨠Features
Univer provides a wide range of features for spreadsheets, documents and presentations. Here are some of the key features:
ð Univer Sheet
- Core Features: Univer supports core spreadsheet functionality, including cells, rows, columns, worksheets, and workbooks.
- Formulas: Extensive support for various formulas, including mathematical, statistical, logical, text, date and time, lookup and reference, engineering, financial, and information formulas.
- Permissions: Allows restricting access to specific elements.
- Number Formatting: Supports formatting numbers based on specific criteria.
- Hyperlinks: Enables linking to external websites, email addresses, and other locations within a spreadsheet.
- Floating Images: Allows inserting images into a spreadsheet and positioning them anywhere on the sheet.
- Find & Replace: Provides the ability to search for specific text within a spreadsheet and replace it with other text.
- Filtering: Allows filtering data based on specific criteria.
- Sorting: Allows sorting data based on specific criteria.
- Data Validation: Supports restricting the type of data that can be entered into a cell.
- Conditional Formatting: Supports applying formatting to cells based on specific criteria.
- Comments: Enables adding comments to cells to provide additional information.
- Pivot Tables1: Supports pivot tables, allowing users to summarize and analyze data.
- Collaborative Editing1: Supports multiple users editing a spreadsheet simultaneously.
- Printing1: Allows printing a spreadsheet or exporting it to PDF.
- Import & Export1: Support for importing and exporting data in XLSX.
- Charts2: Third-party chart support via VChart.
ð Univer Doc (Under Development)
- Core Features: Univer supports core document features, including paragraphs, headings, lists, superscript, subscript, and more.
- Lists: Supports ordered lists, unordered lists, and task lists.
- Hyperlinks: Supports inserting links to external websites, email addresses, and other locations within a document.
- Floating Images: Allows inserting images into a document and supporting text and image layout.
- Headers & Footers: Allows adding headers and footers to a document.
- Comments: Enables adding comments to a document to provide additional information.
- Import1: Supports importing data in DOCX format.
- Collaborative Editing1: Supports multiple users editing a document simultaneously.
ð½ï¸ Univer Slide (Under Development)
- Core Features: Univer will support core presentation features, including slides, shapes, text, images, and more.
ð Internationalization
Univer supports multiple languages, including:
zh-CNzh-TWen-USru-RUvi-VN
zh-CN and en-US are officially supported, while the others are contributed by the community.
You can add the language you want by Using Custom Locales. You can also help us add new language support by referring to the contribution guide.
ð¾ Showcase
You can find all the examples in the Univer Examples.
ð¬ Community
Univer is an inclusive and welcoming project. Please read our Code of Conduct before participating in the community.
Join the Univer community:
- Chat with us and other developers on Discord.
- Start a discussion on GitHub Discussions.
- Open a topic on Stack Overflow and tag it with
univer.
You can also find Univer on:
ð¤ Contribution
We appreciate any kinds of contributing. You can submit issues or feature requests to us. Please read our contributing guide first.
If you would like to contribute code to Univer, please refer to the contributing guide as well. It would guide you through the process of setting up the development environment and submitting a pull request.
â¤ï¸ Sponsors
The growth and development of the Univer project rely on the support of its backers and sponsors. If you are interested in supporting our project, we kindly invite you to consider becoming a sponsor. You can sponsor us through Open Collective.
Thanks to our sponsors, just part of them are listed here because of the space limit, ranking is no particular order:
ð License
Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.
Licensed under the Apache-2.0 license.
Footnotes
Top Related Projects
JavaScript Data Grid / Data Table with a Spreadsheet Look & Feel. Works with React, Angular, and Vue. Supported by the Handsontable team ⚡
The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.
📗 SheetJS Spreadsheet Data Toolkit -- New home https://git.sheetjs.com/SheetJS/sheetjs
Excel Workbook Manager
Luckysheet upgraded to Univer
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















