Material-UI v7 component library patterns including sx prop styling, theme integration, responsive design, and MUI-specific hooks. Use when working with MUI components, styling with sx prop, theme customization, or MUI utilities.
A comprehensive skill for working with Material-UI v7 components, styling, and best practices in React applications.
This skill provides guidance and patterns for building React applications with Material-UI v7 (released March 2025). It covers component usage, the sx prop styling system, theme integration, responsive design, and MUI-specific utilities.
MUI is one of the most popular React UI libraries, and v7 introduced several breaking changes from v6. This skill helps developers navigate these changes while following consistent, type-safe patterns.
Use this skill when you are:
Trigger phrases:
The skill includes guidance on v7-specific changes:
onBackdropClick removed from Modal (use onClose instead)slots and slotProps pattern for all componentsenableCssLayer config (Tailwind v4 compatible)Two approaches based on component complexity:
ComponentName.styles.tsimport { Box, Typography, Button, Paper } from '@mui/material';
import type { SxProps, Theme } from '@mui/material';
const styles: Record<string, SxProps<Theme>> = {
container: {
p: 2,
display: 'flex',
flexDirection: 'column',
gap: 2,
},
header: {
mb: 3,
fontSize: '1.5rem',
fontWeight: 600,
},
};
function MyComponent() {
return (
<Paper sx={styles.container}>
<Typography sx={styles.header}>Title</Typography>
<Button variant="contained">Action</Button>
</Paper>
);
}
<Box
sx={{
width: {
xs: '100%', // 0-600px
sm: '80%', // 600-900px
md: '60%', // 900-1200px
lg: '40%', // 1200px+
},
display: {
xs: 'none', // Hidden on mobile
md: 'block', // Visible on desktop
},
}}
>
Responsive content
</Box>
import { Grid } from '@mui/material';
<Grid container spacing={3}>
<Grid item xs={12} sm={6} md={4} lg={3}>
<Card>...</Card>
</Grid>
<Grid item xs={12} sm={6} md={4} lg={3}>
<Card>...</Card>
</Grid>
</Grid>
<Box
sx={(theme) => ({
color: theme.palette.primary.main,
bgcolor: 'background.paper',
p: 2,
'&:hover': {
color: theme.palette.primary.dark,
},
})}
>
Theme-integrated content
</Box>
@mui/material@mui/icons-material (for icons)This skill produces:
import type { SxProps, Theme } from '@mui/material';
const styles: Record<string, SxProps<Theme>> = {
container: { p: 2 },
};
// Good
<Box sx={{ color: 'primary.main', p: 2 }} />
// Avoid
<Box sx={{ color: '#1976d2', padding: '16px' }} />
// Good - Uses theme.spacing()
<Box sx={{ p: 2, mb: 3, mt: 1 }} />
// Avoid - Random pixel values
<Box sx={{ padding: '17px', marginBottom: '25px' }} />
ComponentName.styles.ts fileAccess palette colors by their semantic names:
primary.main, primary.light, primary.darksecondary.main, error.main, warning.maintext.primary, text.secondarybackground.paper, background.defaultThe skill includes supplementary documentation:
resources/styling-guide.md - Advanced styling patternsresources/component-library.md - Extended component examplesresources/theme-customization.md - Theme setup and customizationUse the mcporter CLI to list, configure, auth, and call MCP servers/tools directly (HTTP or stdio), including ad-hoc servers, config edits, and CLI/type generation.
ElevenLabs text-to-speech with mac-style say UX.
OpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.
Capture and automate macOS UI with the Peekaboo CLI.
Gemini CLI for one-shot Q&A, summaries, and generation.
Send WhatsApp messages to other people or search/sync WhatsApp history via the wacli CLI (not for normal user chats).
Category:developer