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.
Overview
Mantine DataTable is a lightweight, dependency-free, dark-theme aware table component designed for data-rich applications. It offers a variety of features including asynchronous data loading, pagination, column sorting, custom cell data rendering, row expansion, nesting, context menus, and more.
Features
- Lightweight: No external dependencies or bloat.
- Dark-theme aware: Automatically adapts to the current Mantine color scheme.
- Fully customizable: Allows customization of the table and its components.
- Asynchronous data loading: Can load data from a remote API endpoint and display a loading indicator.
- Pagination: Enables splitting large data sets into pages.
- Column sorting: Allows sorting data by one or more columns.
- Custom cell data rendering: Supports rendering cell data using custom components.
- Row context menu: Displays a context menu when right-clicking on a row.
- Row expansion: Expands a row to show additional details.
- Nesting: Supports nesting tables to show hierarchical data.
- Additive batch rows selection: Enables selecting or deselecting ranges of rows using the Shift key.
- Automatically-scrollable: Can be set to automatically scroll or adjust its height based on content.
- AutoAnimate support: Supports animation for row sorting, addition, and removal.
- Column reordering, toggling, and resizing: Provides functionality for column reordering, toggling, and resizing.
- More: Full documentation and examples available.
Installation
To use Mantine DataTable, follow these steps:
- Create a new application with Mantine.
- Install the
mantine-datatable
package using npm i mantine-datatable
or yarn add mantine-datatable
. - Import the necessary CSS files in the correct order.
- Use the Mantine DataTable component in your code.
/* Import the necessary CSS files */
import { DataTable } from "mantine-datatable";
// Use the Mantine DataTable component in your code
Summary
Mantine DataTable is a powerful table component for data-rich applications. With its lightweight design, customizable features, and support for various functionality such as asynchronous data loading, pagination, sorting, and nesting, Mantine DataTable provides a seamless experience for handling and presenting data. It has been trusted and praised by developers and companies around the world, making it a reliable choice for building data-driven applications.