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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@revolist/svelte-datagrid

v4.11.6

Published

Svelte DataGrid Spreadsheet component with native cell render support

Downloads

1,518

Readme

🚨 Repository Notice 🚨

This repo is read-only and will be deprecated in v5+ in favor of monorepos. Post issues here. Happy coding! 🖥️💻


We have updated our latest version to support Svelte 5 following its official release. 🎉
Read more about the announcement here: Svelte 5 is Alive.

If you want to continue using Svelte 4, please switch to the svelte-4 branch or use version prior to 4.11.0.


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 Min 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.

  • Formula Support: Evaluate formulas in cell data.

  • Master Detail/Subtables/Forms: Expand rows to reveal child data.

  • Drag and Drop: Drag and drop in rows and columns.

  • Sorting: Multiple options, customizable per column, with advanced event handling.

  • Filtering:

    • Predefined system 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 grouping (nested headers).
    • Row grouping (nested rows).
  • Cell Editing: In-place editing of cell data.

  • Cell Merging: Merge cells to form groups.

  • Customizations:

    • Column header template.
    • Row header template.
    • Cell template (create your own cell views).
    • Cell editor (use predefined or apply your own custom editors and cell types).
    • Cell properties (define custom properties for rendered cells).
  • Column Types: More details

    • Text/String (default).
    • Number.
    • Select.
    • Date.
    • Custom (create extended styles using any template).
  • Range Operations:

    • Selection.
    • Editing.
  • 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.

  • Additional Customizations and Improvements: Explore hundreds of other small customizations and improvements in RevoGrid.

Usage Svelte

With NPM:

npm i @revolist/svelte-datagrid

With Yarn:

yarn add @revolist/svelte-datagrid;
// App.svelte
<script lang="ts">
    import { RevoGrid, type ColumnRegular } from '@revolist/svelte-datagrid';
    const source = [
    {
      name: '1',
      details: 'Item 1',
    },
    {
      name: '2',
      details: 'Item 2',
    },
  ];
    const columns: ColumnRegular[] = [
    {
      prop: 'name',
      name: 'First',
      cellTemplate(h, { value }) {
        return h('span', { style: { background: 'red' } }, value);
      }
    },
    {
      prop: 'details',
      name: 'Second',
    },
  ];
</script>

<main>
	<RevoGrid {source} {columns}></RevoGrid>
</main>

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?

Our Sponsors

We would like to extend our heartfelt gratitude to our sponsors for their generous support. Their contributions help us maintain and develop RevoGrid.

Altruistiq

Become a Sponsor

If you or your company would like to support the ongoing development of RevoGrid, please consider Sponsor Us 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