Convert Figma logo to code with AI

GriddleGriddle logoGriddle

Simple Grid Component written in React

2,501
379
2,501
176

Top Related Projects

25,069

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table

Feature-rich and customizable data grid React component

React components for efficiently rendering large lists and tabular data

13,037

The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

Quick Overview

Griddle is a customizable React grid component that allows for easy creation of data tables with features like sorting, filtering, and pagination. It provides a flexible and powerful solution for displaying and interacting with tabular data in React applications.

Pros

  • Highly customizable with a plugin architecture
  • Supports server-side data loading and operations
  • Offers built-in responsive design capabilities
  • Provides extensive documentation and examples

Cons

  • Learning curve can be steep for advanced customizations
  • Performance may degrade with large datasets if not optimized
  • Some users report issues with TypeScript definitions
  • Documentation can be overwhelming for beginners

Code Examples

  1. Basic Griddle setup:
import Griddle from 'griddle-react';

const data = [
  { id: 1, name: 'John', age: 24 },
  { id: 2, name: 'Jane', age: 26 },
];

const MyGrid = () => (
  <Griddle data={data} />
);
  1. Custom column definitions:
const columnDefinitions = [
  { id: 'name', title: 'Full Name' },
  { id: 'age', title: 'Age in Years' },
];

const MyGrid = () => (
  <Griddle
    data={data}
    columns={['name', 'age']}
    columnMetadata={columnDefinitions}
  />
);
  1. Using plugins for additional functionality:
import Griddle, { plugins, RowDefinition, ColumnDefinition } from 'griddle-react';

const MyGrid = () => (
  <Griddle
    data={data}
    plugins={[plugins.LocalPlugin]}
    components={{
      Filter: CustomFilterComponent
    }}
  >
    <RowDefinition>
      <ColumnDefinition id="name" title="Name" />
      <ColumnDefinition id="age" title="Age" />
    </RowDefinition>
  </Griddle>
);

Getting Started

To use Griddle in your React project, follow these steps:

  1. Install Griddle:

    npm install griddle-react
    
  2. Import and use Griddle in your component:

    import React from 'react';
    import Griddle from 'griddle-react';
    
    const data = [/* your data array */];
    
    const MyComponent = () => (
      <Griddle data={data} />
    );
    
    export default MyComponent;
    
  3. Customize Griddle with plugins, column definitions, and other options as needed.

Competitor Comparisons

25,069

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table

Pros of Table

  • More active development and maintenance
  • Highly flexible and customizable with a modular architecture
  • Better TypeScript support and type safety

Cons of Table

  • Steeper learning curve due to its flexibility and advanced features
  • Requires more setup and configuration for basic use cases

Code Comparison

Table:

import { useTable } from 'react-table'

function Table({ columns, data }) {
  const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } = useTable({ columns, data })
  // Render table structure using the above properties
}

Griddle:

import Griddle from 'griddle-react'

function Table({ data }) {
  return <Griddle data={data} />
}

Summary

Table offers more flexibility and customization options, making it suitable for complex table requirements. It has better TypeScript support and is actively maintained. However, it may require more setup and has a steeper learning curve.

Griddle provides a simpler API and is easier to get started with for basic table needs. It offers less customization out of the box but can be extended with plugins. The project has seen less recent activity compared to Table.

Choose Table for advanced, highly customizable tables with strong TypeScript support. Opt for Griddle if you need a quick, simple table solution with minimal configuration.

Feature-rich and customizable data grid React component

Pros of react-data-grid

  • More extensive feature set, including built-in editors, formatters, and advanced filtering options
  • Better performance for large datasets due to virtualization
  • More active development and frequent updates

Cons of react-data-grid

  • Steeper learning curve due to more complex API
  • Less customizable styling options out of the box
  • Larger bundle size, which may impact initial load times

Code Comparison

react-data-grid:

import ReactDataGrid from 'react-data-grid';

const columns = [
  { key: 'id', name: 'ID' },
  { key: 'title', name: 'Title', editor: TextEditor }
];

<ReactDataGrid
  columns={columns}
  rows={rows}
  onRowsChange={handleRowsChange}
/>

Griddle:

import Griddle from 'griddle-react';

const columns = ['id', 'title'];

<Griddle
  data={data}
  columns={columns}
  plugins={[plugins.LocalPlugin]}
/>

Both libraries offer React-based data grid solutions, but react-data-grid provides more advanced features and better performance for large datasets. However, this comes at the cost of a more complex API and larger bundle size. Griddle, on the other hand, offers a simpler API and easier customization but may not be as suitable for complex use cases or large datasets. The code comparison shows that react-data-grid requires more configuration but offers built-in editing capabilities, while Griddle has a more straightforward setup process.

React components for efficiently rendering large lists and tabular data

Pros of react-virtualized

  • More comprehensive set of components for virtualized rendering
  • Better performance for large datasets due to efficient windowing techniques
  • Extensive documentation and examples

Cons of react-virtualized

  • Steeper learning curve due to more complex API
  • Less focus on traditional grid/table functionality
  • Requires more manual configuration for basic use cases

Code Comparison

react-virtualized:

import { List } from 'react-virtualized';

<List
  width={300}
  height={300}
  rowCount={1000}
  rowHeight={20}
  rowRenderer={({ key, index, style }) => (
    <div key={key} style={style}>Row {index}</div>
  )}
/>

Griddle:

import Griddle from 'griddle-react';

<Griddle
  data={myData}
  components={{
    Table: ({ Table }) => <Table />
  }}
/>

react-virtualized offers more fine-grained control over rendering and optimization, while Griddle provides a simpler API for basic table functionality. react-virtualized is better suited for handling large datasets with smooth scrolling, whereas Griddle focuses on providing a complete table solution with built-in features like sorting and filtering. The choice between the two depends on the specific requirements of your project and the level of customization needed.

13,037

The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.

Pros of ag-grid

  • More feature-rich with advanced functionalities like pivoting, grouping, and aggregation
  • Better performance for handling large datasets
  • Extensive documentation and community support

Cons of ag-grid

  • Steeper learning curve due to its complexity
  • Larger bundle size, which may impact initial load times
  • Commercial license required for some advanced features

Code Comparison

ag-grid:

import { AgGridReact } from 'ag-grid-react';

<AgGridReact
  columnDefs={columnDefs}
  rowData={rowData}
  onGridReady={onGridReady}
  pagination={true}
/>

Griddle:

import Griddle from 'griddle-react';

<Griddle
  data={data}
  components={components}
  plugins={[plugins.LocalPlugin]}
/>

Both libraries offer React components for creating data grids, but ag-grid provides more built-in features and configuration options out of the box. Griddle focuses on simplicity and customization, allowing developers to build their own plugins and components more easily.

ag-grid is better suited for complex enterprise applications with large datasets and advanced requirements, while Griddle is ideal for simpler use cases where flexibility and ease of customization are prioritized over extensive built-in features.

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

Pros of Material-UI

  • Comprehensive UI component library with a wide range of pre-built components
  • Follows Google's Material Design guidelines, ensuring a modern and consistent look
  • Large and active community, providing extensive documentation and support

Cons of Material-UI

  • Steeper learning curve due to its extensive API and customization options
  • Larger bundle size, which may impact initial load times for applications
  • More opinionated design system, which may require additional effort to customize

Code Comparison

Material-UI:

import { Button, TextField } from '@material-ui/core';

<Button variant="contained" color="primary">
  Click me
</Button>
<TextField label="Enter your name" variant="outlined" />

Griddle:

import Griddle from 'griddle-react';

<Griddle
  data={data}
  components={{
    Table: CustomTable,
    Pagination: CustomPagination
  }}
/>

Summary

Material-UI is a comprehensive UI library following Material Design principles, offering a wide range of components and extensive customization options. It has a large community and excellent documentation but comes with a steeper learning curve and larger bundle size.

Griddle, on the other hand, is specifically focused on creating customizable and performant data grids. It offers a more lightweight solution for tabular data display but lacks the breadth of components found in Material-UI.

Choose Material-UI for full-featured UI development with consistent design, or Griddle for specialized data grid functionality in React applications.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Griddle

Needs more maintainers - Please see this issue

An ultra customizable datagrid component for React

Gitter Build Status


Please check out the documentation and examples.

TLDR: Griddle now has a customizable architecture that allows for one-off customizations or reusable plugins. These customization options allow for overriding everything from components, to internal datagrid state management, and more.


To use Griddle:

npm install griddle-react


To run from source:

  1. npm install
  2. npm run storybook

Issues:

If you run into an issue in Griddle please let us know through the issue tracker. It is incredibly helpful if you create a failing test(s) and/or a storybook story that demonstrates the issue as a pull request and reference this pull request in the issue. To add a storybook story, navigate to /stories/index.js and add a story to the storiesOf('Bug fixes' ...) section.

Contributing:

Please feel free submit any bugs. Any questions should go in the Gitter chat channel or stackoverflow. Pull requests are welcome but if you have an idea please post as an issue first to make sure everyone is on the same-page (and to help avoid duplicate work). If you are looking to help out but don't know where to start, please take a look at approved issues that don't have anyone assigned.

We do most of our initial feature development in the Storybook stories contained in this project. When you run npm run storybook, a web server is setup that quickly provides access to Griddle in various states. All storybook stories are currently in /stories/index.js

We would love any help at all but want to call out the following things:

  • Help maintaining 0.x
  • More tests - we have a number of tests in version 1.0 but not quite where we'd like it to be
  • More plugins

NPM DownloadsLast 30 Days