mantine-data-grid
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

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

Demo & Documentation

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,
        },
      ]}
    />
  );
}

Contributing

Contribution to this project is welcom, feel free to submit a Pull Request.

Run locally

pnpm i

pnpm dev

Roadmap

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

/mantine-data-grid/

    Package Sidebar

    Install

    npm i mantine-data-grid

    Weekly Downloads

    344

    Version

    0.2.3

    License

    MIT

    Unpacked Size

    281 kB

    Total Files

    23

    Last publish

    Collaborators

    • y.kuechlin