Skip to content

Shadowfita/mantine-data-grid

 
 

Repository files navigation

Mantine Data Grid

Version

Data Grid component with Mantine UI and react-table v8.

Component is in alpha stage, there might be bugs and component api could change.

Mantine Data Grid discussion

Install

With npm

npm i mantine-data-grid @mantine/core @mantine/dates @mantine/hooks dayjs

With pnpm

pnpm add mantine-data-grid @mantine/core @mantine/dates @mantine/hooks dayjs

Usage

import { DataGrid, stringFilterFn, numberFilterFn, dateFilterFn } from 'mantine-data-grid';

function Demo() {
  return (
    <DataGrid
      data={/* data source */}
      size="md"
      withGlobalFilter
      columns={[
        {
          accessorKey: 'text',
          header: 'Text that is too long for a Header',
          filterFn: stringFilterFn,
        },
        {
          header: 'Animal',
          columns: [
            { accessorKey: 'cat', filterFn: stringFilterFn },
            {
              accessorKey: 'fish',
              filterFn: stringFilterFn,
            },
          ],
        },
        {
          accessorKey: 'city',
          filterFn: stringFilterFn,
        },
        { accessorKey: 'value', filterFn: numberFilterFn },
        {
          accessorKey: 'date',
          cell: (cell) => cell.getValue()?.toLocaleDateString(),
          filterFn: dateFilterFn,
        },
      ]}
    />
  );
}

Run locally

pnpm i

pnpm dev

Roadmap

  • Simple Data Grid
  • Virualized Data Grid
  • Global Filter
  • Column Filter
    • string filter
    • number filter
    • date filter
    • boolean filter
    • custom fitler
  • Column Sizing
  • Column sorting
  • Scrolling
    • Fixed Header
    • Column pinning
  • Column Ordering
  • Row Selection
  • Pagination
  • Styles Api
  • Docs
  • Create npm package
  • Add tests

About

mantine data grid

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 96.3%
  • JavaScript 2.6%
  • Other 1.1%