Next.js + Mantine
100+ components and hooks (v9). This page shows exactly what pickstack adds to a Next.js project for Mantine: the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.
$ npm create pickstack@latest my-app -- --framework next --modules mantine --yesCustomize in the configurator
Packages it adds
| Package | Version | Type |
|---|---|---|
@mantine/core | ^9.8.2 | runtime |
@mantine/hooks | ^9.8.2 | runtime |
postcss | ^8.5.33 | dev |
postcss-preset-mantine | ^1.18.0 | dev |
postcss-simple-vars | ^7.0.1 | dev |
New files
const config = {
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",
},
},
},
};
export default config;
Changes to existing files
⋯ 2 unchanged lines <section className="page"> <h1 className="title">About</h1> <p className="text">+ Built with Next.js (App Router), React 19, TypeScript, Mantine.− Built with Next.js (App Router), React 19, TypeScript. </p> </section> );⋯ 2 unchanged lines
+import {+ ColorSchemeScript,+ MantineProvider,+ mantineHtmlProps,+} from "@mantine/core"; import type { Metadata } from "next"; import Link from "next/link"; import "./globals.css";+import "@mantine/core/styles.css"; export const metadata: Metadata = { title: "my-app",⋯ 2 unchanged lines export default function RootLayout({ children }: LayoutProps<"/">) { return (+ <html lang="en" {...mantineHtmlProps}>+ <head>+ <ColorSchemeScript />+ </head>− <html lang="en"> <body>+ <MantineProvider>+ <main className="app">+ <nav className="nav">+ <Link className="link" href="/">+ Home+ </Link>+ <Link className="link" href="/about">+ About+ </Link>+ </nav>+ {children}+ </main>+ </MantineProvider>− <main className="app">− <nav className="nav">− <Link className="link" href="/">− Home− </Link>− <Link className="link" href="/about">− About− </Link>− </nav>− {children}− </main> </body> </html> );⋯ 2 unchanged lines
"use client"; +import { Button, Card, Group, Text, Title } from "@mantine/core"; import { useState } from "react"; export default function Counter() { const [count, setCount] = useState(0); return (+ <Card withBorder shadow="sm" radius="md" padding="xl" miw={240} ta="center">+ <Title order={2} size="h4">+ Counter+ </Title>+ <Text fz={48} fw={700} style={{ fontVariantNumeric: "tabular-nums" }}>+ {count}+ </Text>+ <Group justify="center" mt="md">+ <Button variant="default" onClick={() => setCount((n) => n - 1)}>− <div className="card">− <p className="count">{count}</p>− <div className="row">− <button− type="button"− className="btn"− onClick={() => setCount((n) => n - 1)}− > -1+ </Button>+ <Button onClick={() => setCount((n) => n + 1)}>+1</Button>+ </Group>+ </Card>− </button>− <button− type="button"− className="btn"− onClick={() => setCount((n) => n + 1)}− >− +1− </button>− </div>− </div> ); }
Project files
.gitignoreREADME.mdapp/about/page.tsxapp/globals.cssapp/layout.tsxapp/page.tsxcomponents/Counter.tsxnext.config.tspackage.jsonpostcss.config.mjstsconfig.json