2.33.0 • Published 11 months ago

@refinedev/mantine v2.33.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Discord Twitter Follow

It eliminates repetitive tasks in CRUD operations and provides industry-standard solutions for critical project components like authentication, access control, routing, networking, state management, and i18n.

Mantine UI integration for Refine

Mantine is a React components library focused on providing great user and developer experience.

Refine is headless by design, offering unlimited styling and customization options. Moreover, Refine ships with ready-made integrations for Ant Design, Material UI, Mantine, and Chakra UI for convenience.

Refine has connectors for 15+ backend services, including REST API, GraphQL, and popular services like Airtable, Strapi, Supabase, Firebase, and NestJS.

Installation

To use Refine with Mantine, you need to install the following package @refinedev/mantine along with the Mantine packages:

npm install @refinedev/mantine @refinedev/react-table @mantine/core@5 @mantine/hooks@5 @mantine/form@5 @mantine/notifications@5 @emotion/react @tabler/icons

⚡ Try Refine

Start a new project with Refine in seconds using the following command:

npm create refine-app@latest my-refine-app

Or you can create a new project on your browser:

Quick Start

Here's Refine in action, the below code is an example of a simple CRUD application using Refine + React Router + Material UI:

import React from "react";
import { Refine, useMany } from "@refinedev/core";
import { ThemedLayoutV2 } from "@refinedev/mui";
import dataProvider from "@refinedev/simple-rest";
import routerBindings from "@refinedev/react-router-v6";
import { BrowserRouter, Outlet, Route, Routes } from "react-router-dom";

import CssBaseline from "@mui/material/CssBaseline";

export default function App() {
  return (
    <BrowserRouter>
      <CssBaseline />
      <Refine
        dataProvider={dataProvider("https://api.fake-rest.refine.dev")}
        routerProvider={routerBindings}
        resources={[
          {
            name: "products",
            list: "/products",
          },
        ]}
      >
        <Routes>
          <Route
            element={
              <ThemedLayoutV2>
                <Outlet />
              </ThemedLayoutV2>
            }
          >
            <Route path="/products">
              <Route index element={<ProductList />} />
            </Route>
          </Route>
        </Routes>
      </Refine>
    </BrowserRouter>
  );
}

// src/pages/products/list.tsx

import { List, useDataGrid, DateField } from "@refinedev/mui";
import { DataGrid, GridColDef } from "@mui/x-data-grid";

export const ProductList = () => {
  const { dataGridProps } = useDataGrid();

  const { data: categories, isLoading } = useMany({
    resource: "categories",
    ids:
      dataGridProps?.rows?.map((item) => item?.category?.id).filter(Boolean) ??
      [],
    queryOptions: {
      enabled: !!dataGridProps?.rows,
    },
  });

  const columns = React.useMemo<GridColDef[]>(
    () => [
      { field: "id", headerName: "ID", type: "number" },
      { field: "name", flex: 1, headerName: "Name" },
      {
        field: "category",
        flex: 1,
        headerName: "Category",
        renderCell: ({ value }) =>
          isLoading
            ? "Loading..."
            : categories?.data?.find((item) => item.id === value?.id)?.title,
      },
      {
        field: "createdAt",
        flex: 1,
        headerName: "Created at",
        renderCell: ({ value }) => <DateField value={value} />,
      },
    ],
    [categories?.data, isLoading],
  );

  return (
    <List>
      <DataGrid {...dataGridProps} columns={columns} autoHeight />
    </List>
  );
};

The result will look like this:

Refine + Material UI Example

Documentation

2.32.0

1 year ago

2.32.2

12 months ago

2.32.1

12 months ago

2.31.0

1 year ago

2.33.0

11 months ago

2.30.2

1 year ago

2.30.1

1 year ago

2.30.0

1 year ago

2.29.5

1 year ago

2.29.4

1 year ago

2.29.3

1 year ago

2.29.2

1 year ago

2.29.1

2 years ago

2.29.0

2 years ago

2.28.20

2 years ago

2.28.21

2 years ago

2.25.0

2 years ago

2.27.0

2 years ago

2.28.13

2 years ago

2.28.14

2 years ago

2.28.11

2 years ago

2.28.12

2 years ago

2.28.10

2 years ago

2.22.1

2 years ago

2.22.0

2 years ago

2.28.19

2 years ago

2.28.17

2 years ago

2.28.18

2 years ago

2.28.15

2 years ago

2.28.16

2 years ago

2.28.9

2 years ago

2.28.8

2 years ago

2.28.5

2 years ago

2.28.4

2 years ago

2.28.7

2 years ago

2.28.6

2 years ago

2.28.1

2 years ago

2.28.0

2 years ago

2.28.3

2 years ago

2.28.2

2 years ago

2.24.0

2 years ago

2.22.2

2 years ago

2.26.0

2 years ago

2.23.0

2 years ago

2.21.0

2 years ago

2.19.0

2 years ago

2.17.0

2 years ago

2.15.0

2 years ago

2.13.0

2 years ago

2.20.0

2 years ago

2.12.9

2 years ago

2.12.7

2 years ago

2.12.8

2 years ago

2.16.1

2 years ago

2.14.3

2 years ago

2.12.5

2 years ago

2.18.0

2 years ago

2.16.2

2 years ago

2.14.4

2 years ago

2.14.1

2 years ago

2.12.3

2 years ago

2.16.0

2 years ago

2.14.2

2 years ago

2.12.4

2 years ago

2.14.0

2 years ago

2.12.2

2 years ago

2.12.1

2 years ago

2.12.0

2 years ago

2.11.0

2 years ago

2.10.0

2 years ago

2.9.0

2 years ago

2.8.0

2 years ago

2.7.4

2 years ago

2.7.3

2 years ago

2.7.2

2 years ago

2.7.1

2 years ago

2.7.0

2 years ago

2.6.0

2 years ago

2.5.2

2 years ago

2.5.1

2 years ago

2.5.0

2 years ago

2.4.0

2 years ago

2.3.7

2 years ago

2.3.6

2 years ago

2.3.5

2 years ago

2.3.4

2 years ago

2.3.3

2 years ago

2.3.2

2 years ago

2.3.1

2 years ago

2.3.0

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago