GithubHelp home page GithubHelp logo

icflorescu / mantine-datatable Goto Github PK

View Code? Open in Web Editor NEW
841.0 9.0 60.0 5.08 MB

The table component for your Mantine data-rich applications, supporting asynchronous data loading, column sorting, custom cell data rendering, context menus, nesting, Gmail-style batch row selection, dark theme, and more.

Home Page: https://icflorescu.github.io/mantine-datatable/

License: MIT License

JavaScript 0.67% TypeScript 91.09% CSS 8.23% HTML 0.01%
datagrid datatable mantine react typescript ui javascript dark-mode dark-theme uikit

mantine-datatable's Introduction

Mantine DataTable

Publish NPM & deploy docs workflow
NPM version License Stars Last commit Closed issues Downloads Language Sponsor the author

The lightweight, dependency-free, dark-theme aware table component for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, intuitive Gmail-style additive batch rows selection, column sorting, custom cell data rendering, row expansion, nesting, context menus, and much more.

Mantine DataTable

⚠️ Mantine DataTable V7 is compatible with Mantine V7.
πŸ’‘ If you're looking for the old version that works with Mantine V6, head over to Mantine DataTable V6.

Features

Trusted by the community

Emil Sorensen @ kapa.ai:

Mantine DataTable is a great component that’s core to our web app - it saves us a ton of time and comes with great styling and features out of the box

Giovambattista Fazioli @ Namecheap (@gfazioli is also a valuable Mantine DataTable contributor):

Thank you for the wonderful, useful, and beautiful DataTable that has allowed me to create several applications without any problem πŸ‘

Mantine DataTable is used by developers and companies around the world, such as: SegmentX, Namecheap, EasyWP, Aquarino, Dera, kapa.ai, exdatis.ai, teachfloor, MARKUP, BookieBase, zipline, Pachtop, Ganymede, COH3 Stats, Culver City Rental Registry and many more.

If you're using Mantine DataTable in your project, please drop me a line at the email address listed in my GitHub profile and I'll be happy to add it to the list and on the documentation website.

Full documentation and examples

Visit icflorescu.github.io/mantine-datatable to view the full documentation and learn how to use it by browsing a comprehensive list of examples.

Quickstart

Create a new application with Mantine, make sure to have the clsx peer dependency installed, then install the package with npm i mantine-datatable or yarn add mantine-datatable.

Import the necessary CSS files:

import '@mantine/core/styles.layer.css';
import 'mantine-datatable/styles.layer.css';
import './layout.css';

Make sure to apply the styles in the correct order:

/* layout.css */
/* πŸ‘‡ Apply Mantine core styles first, DataTable styles second */
@layer mantine, mantine-datatable;

Use the component in your code:

'use client';

import { Box } from '@mantine/core';
import { showNotification } from '@mantine/notifications';
import { DataTable } from 'mantine-datatable';

export function GettingStartedExample() {
  return (
    <DataTable
      withTableBorder
      borderRadius="sm"
      withColumnBorders
      striped
      highlightOnHover
      // πŸ‘‡ provide data
      records={[
        { id: 1, name: 'Joe Biden', bornIn: 1942, party: 'Democratic' },
        // more records...
      ]}
      // πŸ‘‡ define columns
      columns={[
        {
          accessor: 'id',
          // πŸ‘‡ this column has a custom title
          title: '#',
          // πŸ‘‡ right-align column
          textAlign: 'right',
        },
        { accessor: 'name' },
        {
          accessor: 'party',
          // πŸ‘‡ this column has custom cell data rendering
          render: ({ party }) => (
            <Box fw={700} c={party === 'Democratic' ? 'blue' : 'red'}>
              {party.slice(0, 3).toUpperCase()}
            </Box>
          ),
        },
        { accessor: 'bornIn' },
      ]}
      // πŸ‘‡ execute this callback when a row is clicked
      onRowClick={({ record: { name, party, bornIn } }) =>
        showNotification({
          title: `Clicked on ${name}`,
          message: `You clicked on ${name}, a ${party.toLowerCase()} president born in ${bornIn}`,
          withBorder: true,
        })
      }
    />
  );
}

Make sure to browse the comprehensive list of usage examples to learn how to unleash the full power of Mantine DataTable.

Other useful resources

Mantine DataTable works perfectly with Mantine Context Menu, a library built by the same author that enables you to enhance your UIs with desktop-grade, lightweight yet fully-featured context menus that respect the Mantine color scheme out of the box:

Mantine ContextMenu

Contributing

See the contributing guide in the documentation website or the repo CONTRIBUTING.md file for details.

Here's the list of people who have already contributed to Mantine DataTable:

Contributors list

Want to become a code contributor?

Support the project

If you find this package useful, please consider ❀️ sponsoring my work.
Your sponsorship will help me dedicate more time to maintaining the project and will encourage me to add new features and fix existing bugs.
If you're a company using Mantine, Mantine DataTable or Mantine ContextMenu in a commercial project, you can also hire my services.

Other means of support

If you can't afford to sponsor the project or hire my services, there are other ways you can support my work:

The more stars this repository gets, the more visibility it gains among the Mantine users community. The more users it gets, the more chances that some of those users will become active code contributors willing to put their effort into bringing new features to life and/or fixing bugs.

As the repository gain awareness, my chances of getting hired to work on Mantine-based projects will increase, which in turn will help maintain my vested interest in keeping the project alive.

Hiring the author

If you want to hire my services, don’t hesitate to drop me a line at the email address listed in my GitHub profile. I’m currently getting a constant flow of approaches, some of them relevant, others not so relevant. Mentioning β€œMantine DataTable” in your text would help me prioritize your message.

Acknowledgements

πŸ™ Special thanks to Ani Ravi for being the first person to sponsor my work on this project! πŸ’• Additional thanks to all sponsors!

License

The MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.