skills/m3-web-react/SKILL.md
Implement Material Design 3 in React using MUI (Material UI) with M3-aligned theming, or @material/web with React wrappers. Covers theme setup, component usage, dark mode, and Next.js SSR integration. Use this when building M3-styled React or Next.js applications.
npx skillsauth add shelbeely/shelbeely-agent-skills m3-web-reactInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
MUI (@mui/material) is the most popular React UI library. MUI v6 adds the Pigment CSS engine for better performance. M3 theming support is evolving — MUI primarily implements M2 component APIs but supports M3 color tokens and theming through customization.
Keywords: Material Design 3, M3, React, MUI, Material UI, @mui/material, Next.js, SSR, React Server Components, material-web-components-react
npm install @mui/material @emotion/react @emotion/styled
For Next.js SSR:
npm install @mui/material @emotion/react @emotion/styled @mui/material-nextjs
import { createTheme, ThemeProvider } from '@mui/material/styles';
const m3Theme = createTheme({
palette: {
primary: { main: '#6750A4' },
secondary: { main: '#625B71' },
error: { main: '#B3261E' },
background: {
default: '#FEF7FF',
paper: '#F3EDF7',
},
},
shape: { borderRadius: 20 }, // M3 Large radius
typography: {
fontFamily: '"Roboto", sans-serif',
},
});
const m3ThemeDark = createTheme({
palette: {
mode: 'dark',
primary: { main: '#D0BCFF' },
secondary: { main: '#CCC2DC' },
error: { main: '#F2B8B5' },
background: {
default: '#141218',
paper: '#2B2930',
},
},
shape: { borderRadius: 20 },
typography: {
fontFamily: '"Roboto", sans-serif',
},
});
function App() {
return (
<ThemeProvider theme={m3Theme}>
{/* Your M3-styled components */}
</ThemeProvider>
);
}
import Button from '@mui/material/Button';
<Button variant="contained">Filled</Button>
<Button variant="outlined">Outlined</Button>
<Button variant="text">Text</Button>
import Card from '@mui/material/Card';
import CardContent from '@mui/material/CardContent';
import Typography from '@mui/material/Typography';
<Card elevation={1}>
<CardContent>
<Typography variant="h6">Title</Typography>
<Typography variant="body2">Content</Typography>
</CardContent>
</Card>
import TextField from '@mui/material/TextField';
<TextField label="Email" variant="outlined" />
<TextField label="Name" variant="filled" />
import BottomNavigation from '@mui/material/BottomNavigation';
import BottomNavigationAction from '@mui/material/BottomNavigationAction';
import HomeIcon from '@mui/icons-material/Home';
import SearchIcon from '@mui/icons-material/Search';
<BottomNavigation value={value} onChange={handleChange}>
<BottomNavigationAction label="Home" icon={<HomeIcon />} />
<BottomNavigationAction label="Search" icon={<SearchIcon />} />
</BottomNavigation>
// app/layout.tsx
import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter';
import { ThemeProvider } from '@mui/material/styles';
import { m3Theme } from './theme';
export default function RootLayout({ children }) {
return (
<html>
<body>
<AppRouterCacheProvider>
<ThemeProvider theme={m3Theme}>
{children}
</ThemeProvider>
</AppRouterCacheProvider>
</body>
</html>
);
}
@material/web in ReactUse Google's official web components directly in React:
// Client component (Next.js or Vite)
'use client';
import '@material/web/button/filled-button.js';
export function M3Button({ children }) {
return <md-filled-button>{children}</md-filled-button>;
}
React wrappers: material-web-components-react provides thin React abstractions over @material/web.
createTheme using M3 color rolesborderRadius: 20)AppRouterCacheProvider wraps the app for SSRtheme.ts — Ready-to-use MUI theme config with M3 orange palette (light + dark) included in this skill's directory. Copy into your project and customize.material-theme-builder skill — Generate a custom palette from any source color.tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
development
Generate Material Design 3 color themes programmatically from a source color using @material/material-color-utilities, the same engine that powers the Material Theme Builder. Use this when the user asks to generate an M3 color palette, create a custom theme from a brand color, or export M3 tokens to CSS, JSON, or framework configs.
testing
Applies Material Design 3 Expressive typography principles including variable fonts, type scales, and hierarchy. Use this when working on text styling, type hierarchy, readable interfaces, or when the user asks to apply Material Design 3 typography guidelines.
testing
Applies Material Design 3 Expressive shape and containment principles including rounded corners, morphing shapes, and container design. Use this when working on component shapes, borders, containment, or when the user asks to apply Material Design 3 shape guidelines.