Usage with Vite
Get started with a template
The easiest way to get started is to use one of the templates. All templates are configured correctly: they include PostCSS setup, ColorSchemeScript and other essential features. Some templates also include additional features like Jest, Storybook and ESLint.
If you are not familiar with GitHub, you can find detailed instructions on how to bootstrap a project from a template on this page.
vite-template Vite template with full setup: Vitest, Prettier, Storybook, ESLint | Use template | |
vite-min-template Vite template with minimal setup – no additional tools included, only default Vite configuration | Use template | |
vite-vanilla-extract-template Vite template with Vanilla extract example | Use template |
Generate new application
Follow the Vite getting started guide to create a new Vite application:
Installation
Choose packages that you will use in your application:
| Package | Description | |
|---|---|---|
@mantine/hooks | Hooks for state and UI management | |
@mantine/core | Core components library: inputs, buttons, overlays, etc. | |
@mantine/form | Form management library | |
@mantine/dates | Date inputs, calendars | |
@mantine/charts | Recharts based charts library | |
@mantine/notifications | Notifications system | |
@mantine/code-highlight | Code highlight with your theme colors and styles | |
@mantine/tiptap | Rich text editor based on Tiptap | |
@mantine/dropzone | Capture files with drag and drop | |
@mantine/carousel | Embla based carousel component | |
@mantine/spotlight | Overlay command center | |
@mantine/modals | Centralized modals manager | |
@mantine/nprogress | Navigation progress |
Install dependencies:
PostCSS setup
Install PostCSS plugins and postcss-preset-mantine:
Create a postcss.config.cjs file at the root of your application with the following content:
Setup
Add styles imports and MantineProvider to your application root component (usually App.tsx):
All set! Start the development server: