Mantine UI library for React: 100+ components, hooks, forms, theming, dark mode, CSS modules, and Vite/TypeScript setup.
Mantine is a fully-featured React components library with TypeScript support. It provides 100+ hooks and components with native dark mode, CSS-in-JS via CSS modules, and excellent accessibility.
This skill focuses on:
# Use official template (recommended)
git clone https://github.com/mantinedev/vite-template my-app
cd my-app
yarn install
yarn dev
Or manual setup:
npm create vite@latest my-app -- --template react-ts
cd my-app
npm install @mantine/core @mantine/hooks
npm install -D postcss postcss-preset-mantine postcss-simple-vars
# Core packages
npm install @mantine/core @mantine/hooks
# Optional packages (as needed)
npm install @mantine/form # Form management
npm install @mantine/dates dayjs # Date components
npm install @mantine/charts recharts # Charts
npm install @mantine/notifications # Toast notifications
npm install @mantine/modals # Modal manager
npm install @mantine/dropzone # File upload
npm install @mantine/spotlight # Command palette
npm install @mantine/tiptap @tiptap/react @tiptap/pm @tiptap/starter-kit # Rich text editor
Create postcss.config.cjs:
module.exports = {
plugins: {
"postcss-preset-mantine": {},
"postcss-simple-vars": {
variables: {
"mantine-breakpoint-xs": "36em",
"mantine-breakpoint-sm": "48em",
"mantine-breakpoint-md": "62em",
"mantine-breakpoint-lg": "75em",
"mantine-breakpoint-xl": "88em",
},
},
},
};
// src/App.tsx
import "@mantine/core/styles.css";
// Other style imports as needed:
// import '@mantine/dates/styles.css';
// import '@mantine/notifications/styles.css';
import { MantineProvider, createTheme } from "@mantine/core";
const theme = createTheme({
// Theme customization here
});
function App() {
return <MantineProvider theme={theme}>{/* Your app */}</MantineProvider>;
}
@mantine/core/styles.css — components won't style without itkey={form.key('path')} when using uncontrolled formsWraps your app, provides theme context and color scheme management.
Customize colors, typography, spacing, component default props.
All components accept style props like mt, p, c, bg, etc.
All theme values exposed as CSS variables (e.g., --mantine-color-blue-6).
Many components support component prop to render as different elements.
@mantine/core/styles.css)