Material UI Tutorial
Learn Material UI step by step: 36 lessons in 9 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is Material UI? Learn what Material UI is, how it relates to Material Design, which MUI packages exist, and when a component library is the right choice for your React app.
- Installing and Setting Up Material UI Install Material UI in a React project, add Emotion, Roboto and icons, understand peer dependencies, and choose between path imports and the barrel import.
- First App: ThemeProvider and CssBaseline Wire up a real Material UI app: wrap it in ThemeProvider, add CssBaseline for consistent styles, use createTheme, and learn how the theme reaches every component.
- The sx Prop Basics Style Material UI components with the sx prop: spacing and color shorthands, theme-aware values, pseudo-selectors and responsive objects, with runnable stand-ins.
Components and Props
- Buttons and Icon Buttons Learn the Material UI Button, IconButton, ButtonGroup and Fab: variants, colors, sizes, start and end icons, loading state, links and accessibility labels.
- Typography Use the Material UI Typography component well: variants such as h1 and body1, the component prop for semantic HTML, color, alignment, noWrap and responsive sizes.
- Paper, Card, Avatar and Chip Build surfaces and content blocks with Material UI: Paper elevation and outlined variants, the Card family, CardActionArea, Avatar, Divider and deletable Chips.
- Alerts, Dialogs and Snackbars Give users feedback with Material UI: Alert severities, modal Dialog with actions, Snackbar with auto-hide, and when to use each one without overwhelming people.
- Common Props: component, ref and slots Learn the props almost every Material UI component shares: component for polymorphism, ref, className, sx, slots and slotProps, and how extra props are passed down.
Layout and Grid
- Box and Container Use Material UI Box as a utility wrapper and Container to center content with maxWidth and gutters. Learn spacing, display, flex props and page shells.
- Stack and Spacing Arrange items in one dimension with Material UI Stack: direction, spacing, dividers, alignment, responsive direction and how it differs from Box and Grid.
- The Grid System Build responsive page layouts with the Material UI Grid: container and item sizes on a 12-column system, breakpoint sizes, spacing, offsets, auto and grow, and nested grids.
- Responsive Design and Breakpoints Make Material UI layouts responsive: the five default breakpoints, breakpoint objects in sx, theme.breakpoints helpers, the useMediaQuery hook and custom breakpoints.
Inputs and Forms
- TextField and Text Inputs Master the Material UI TextField: controlled values, label and helperText, variants, error state, multiline, input adornments, password fields and accessibility.
- Select and Autocomplete Choose from lists with Material UI: Select with MenuItem, multiple selection, native selects, and Autocomplete with filtering, free solo, async options and grouping.
- Checkbox, Radio and Switch Use Material UI selection controls: Checkbox with indeterminate state, RadioGroup, Switch, FormControlLabel and FormGroup, plus accessibility and when to pick each one.
- Slider, Rating and Toggle Buttons Capture numbers and preferences visually with Material UI: Slider with marks and ranges, Rating stars, and ToggleButtonGroup in exclusive or multiple mode.
- Form Validation with MUI Build validated forms with Material UI: touched state, error and helperText, submit handling, focusing the first error, accessibility, and React Hook Form with Controller.
Theming and Customization
- Theme Basics and ThemeProvider Learn how a Material UI theme works: createTheme, ThemeProvider, palette, typography, spacing and breakpoints, and how components read theme values.
- Dark Mode and Color Schemes Add dark mode to Material UI with colorSchemes, CSS variables, useColorScheme and a system-preference toggle, without a flash of the wrong theme.
- The sx Prop and styled() Style Material UI components with the sx prop and the styled() API: theme-aware values, responsive objects, pseudo-selectors, nested rules and when to use each.
- Component Overrides and Variants Customize every Material UI component from the theme: defaultProps, styleOverrides, custom variants, TypeScript module augmentation, slots and slotProps.
Navigation and Data Display
- App Bar and Drawer Navigation Build the shell of an app with Material UI AppBar, Toolbar and Drawer: permanent, temporary and mini variants, responsive layout and accessible menu buttons.
- Tabs, Menus and Breadcrumbs Use Material UI Tabs, TabPanel patterns, Menu, MenuItem and Breadcrumbs: controlled value, anchorEl state, keyboard behavior and accessible markup.
- Tables, Pagination and Data Grid Show data with Material UI Table, TableSortLabel and TablePagination, then learn when to move to the MUI X Data Grid for sorting, filtering and virtualization.
- Dialogs, Snackbars and Feedback Give users feedback with Material UI Dialog, Snackbar, Alert, CircularProgress, LinearProgress and Skeleton, including focus handling, queues and accessibility.
Performance and Patterns
- Bundle Size and Imports Keep a Material UI app small: path imports vs barrel imports, tree shaking, icon imports, code splitting with React.lazy, and how to analyze your bundle.
- Rendering Performance and sx Cost Make Material UI screens fast: the real cost of the sx prop, stable theme and style objects, React.memo, avoiding re-render storms, and list virtualization.
- Composition and Custom Components Build your own components on Material UI: the component prop, wrapping with ref and sx forwarding, router links, polymorphic components and design-system patterns.
Next.js and Tooling
- Next.js App Router Setup Set up Material UI in the Next.js App Router: the Emotion cache provider, ThemeProvider in a client component, use client boundaries, fonts and the server-client split.
- SSR, Emotion and the Theme Flash Understand server-side rendering with Material UI and Emotion: how styles are collected, why hydration mismatches happen, and how to remove flashes of unstyled or wrong-colored content.
- Tooling: TypeScript, Testing, Migration Set up Material UI with Vite and TypeScript, type sx and wrappers, test components with Testing Library, lint imports and upgrade between major versions.
Projects and Practice
- Project: Admin Dashboard Build an admin dashboard with Material UI: responsive layout, stat cards, a themed chart-free bar graph, recent orders table and a dark mode switch, with a runnable stand-in.
- Project: Settings Form Build a settings page with Material UI: TextField validation, Switch, Select, dirty tracking, a save button with loading state and a Snackbar, with a runnable stand-in.
- Project: Data Table with Filters Build a data table with Material UI: debounced search, status filter chips, sorting, pagination, empty and loading states, and URL-friendly state, with a runnable stand-in.
- Practice Exercises and Cheat Sheet Test your Material UI skills with ten theming, navigation, performance and Next.js exercises, then keep a compact cheat sheet of sx shortcuts, theme keys and patterns.