Material UI Interview Questions and Answers: Top 30 (2026)

Material UI interview questions and answers 2026 - CodingHumans

Material UI interview questions come up in almost every React interview where the team ships an MUI-based product. Interviewers rarely ask you to list components. They want to know how you style them, how you theme a whole app, how you keep the bundle small, and what changed between versions. Material UI v9 came out in April 2026 and skipped v8 entirely, so "which version are you on, and what broke?" is now a common opener.

Below are 30 questions grouped from basics to architecture. Each answer is short enough to say out loud, and each one explains why, because the follow-up is almost always "why would you do it that way?"

1. Basics and setup

Q1. What is Material UI, and how is it different from Material Design?

Material Design is Google's design language: rules for spacing, elevation, colour and motion. Material UI is an open-source React component library from MUI that implements those rules as ready-made components such as Button, TextField, Dialog and DataGrid (the last one is in MUI X). You can follow Material Design without Material UI, and you can theme Material UI so heavily that it no longer looks like Material Design. Many companies do exactly that.

Q2. Which MUI packages do you usually install, and what does each one do?

  • @mui/material: the core components.
  • @emotion/react and @emotion/styled: the default styling engine that Material UI uses under the hood.
  • @mui/icons-material: Material icons as React components (optional).
  • @mui/x-data-grid, @mui/x-date-pickers and other MUI X packages: advanced components, some of them under a commercial licence.

A good answer also mentions that you only add what you use. Icons and MUI X packages are large, so they shouldn't be installed "just in case".

Q3. Why does Material UI jump from v7 to v9?

MUI released Material UI v9 in April 2026 and skipped v8 on purpose, so that Material UI and MUI X share the same major version number again. For an interview, the useful part is what v9 changed: it removed long-deprecated props (the old components/componentsProps style is gone in favour of slots/slotProps), removed deprecated system props from layout components, improved keyboard navigation in Tabs, Menu and Stepper, and added components such as NumberField and Menubar. If you say "we're on v7 and plan to upgrade by first fixing deprecation warnings", that's a strong practical answer.

Q4. What do ThemeProvider and CssBaseline do?

ThemeProvider puts your theme object into React context so every MUI component, and every sx prop, can read palette, spacing, typography and breakpoints from it. CssBaseline applies a consistent baseline: it removes default margins, sets box-sizing, applies the theme's background and text colour to the body, and enables font smoothing. Without it, the same app can look slightly different across browsers.

Q5. What is the difference between Material UI, MUI System and Base UI?

Material UI is the styled component library. MUI System is the styling layer underneath it: the sx prop, styled(), and layout helpers like Box and Stack. Base UI is MUI's separate library of unstyled, accessible components. You use it when you want MUI's behaviour and accessibility but your own design system and CSS approach. Some newer Material UI components are built on Base UI internally.

Q6. Which styling engine does Material UI use today?

Emotion, a CSS-in-JS library that generates styles at runtime. MUI experimented with Pigment CSS, a zero-runtime engine, but in its January 2026 update MUI said Pigment CSS is on hold and still in alpha. MUI has said that the next major version aims to remove the hard dependency on Emotion. So the honest 2026 answer is: Emotion now, with a planned move away from it, and you shouldn't build new production code on Pigment CSS yet.

2. Styling: sx, styled() and overrides

Q7. When do you use the sx prop, styled(), or theme overrides?

ToolBest forWhy
sxOne-off tweaks on a single elementQuick, reads theme values, supports responsive objects
styled()A reusable styled component used in many placesStyles are defined once, not recreated per render
theme.componentsChanging how every instance of a component looksOne central place for the design system

The rule of thumb: if you copy the same sx object into a third file, it belongs in styled() or in the theme.

Q8. Why can heavy sx usage hurt performance?

Each sx object is converted to CSS at runtime by Emotion. In a list of hundreds of rows, that work is repeated for every row on every render. Fixes: move shared styles into styled() or theme overrides, keep sx objects stable (define them outside the component when they don't depend on props), and virtualise long lists. MUI improved sx performance in v9, but the advice still holds for very large lists.

Q9. What is shouldForwardProp in styled(), and when do you need it?

When you pass a custom prop such as active to a styled component, it would normally be forwarded to the DOM element and trigger a React warning about an unknown attribute. shouldForwardProp lets you filter it out: the prop is used for styling but never reaches the DOM.

const Tab = styled('button', {
  shouldForwardProp: (prop) => prop !== 'active',
})(({ theme, active }) => ({
  color: active ? theme.palette.primary.main : theme.palette.text.secondary,
}));

Q10. How do you change the default look of every Button in the app?

Use the theme's components key. defaultProps changes default prop values and styleOverrides changes styles per slot:

const theme = createTheme({
  components: {
    MuiButton: {
      defaultProps: { disableElevation: true },
      styleOverrides: { root: { textTransform: 'none', borderRadius: 10 } },
    },
  },
});

This is better than wrapping Button in your own component just to add styles, because third-party code and MUI's internal Buttons pick up the change too.

Q11. How do you add a custom variant, such as a "dashed" Button?

Add it under variants in the component's theme entry, with a props matcher and a style. In TypeScript you also extend the component's props interface through module augmentation, so variant="dashed" type-checks. Interviewers like this question because it shows you can extend the design system without forking components.

Q12. What are state classes like .Mui-disabled and .Mui-focused?

MUI adds global state classes to components when they're disabled, focused, selected, checked, expanded or in error. You target them with nested selectors such as '&.Mui-disabled' inside sx or styleOverrides. This is more reliable than guessing generated class names, which change between builds.

Q13. Your global CSS is overriding MUI styles, or the other way round. How do you control the order?

The problem is CSS injection order. MUI injects Emotion styles into the head, and whichever rule comes later wins when specificity is equal. You can wrap the app in StyledEngineProvider with injectFirst so MUI's styles are injected first and your own CSS (for example Tailwind or CSS Modules) can override them. In Next.js, the @mui/material-nextjs integration handles this setup for the App Router.

3. Theming and dark mode

Q14. What goes into createTheme?

The main keys are palette (colours), typography (font family and variants), spacing (the base unit, 8px by default), breakpoints, shape (border radius) and components (defaults and overrides). A design system usually maps its design tokens into these keys once, so components never hard-code a colour or pixel value.

Q15. What does theme.spacing(2) return, and why use it?

With the default 8px unit, theme.spacing(2) returns "16px". In sx you can just write p: 2. Using the spacing scale keeps the whole UI on a consistent grid, and if the design team changes the base unit, every spacing value updates from one place.

Q16. How do responsive styles work in MUI?

Breakpoints are mobile-first: xs, sm, md, lg, xl. In sx you pass an object such as { fontSize: { xs: 14, md: 18 } }. In styled() or overrides you use theme.breakpoints.up('md') as a media query key. For logic in JavaScript there is the useMediaQuery hook, but CSS-based responsiveness is preferred because it avoids extra renders and works with server rendering.

Q17. How do you implement dark mode without a flash of the wrong theme?

Turn on CSS theme variables and define both schemes in the theme:

const theme = createTheme({
  cssVariables: { colorSchemeSelector: 'class' },
  colorSchemes: { light: true, dark: true },
});

MUI then outputs colours as CSS variables, and switching mode just changes a class on the root element instead of re-rendering the whole tree with a new theme. The useColorScheme hook reads and sets the mode. On server-rendered apps, the init script MUI provides sets the class before the page paints, which avoids the flash. In v9 the theme can also generate derived colours with CSS color-mix().

Q18. How do you add a custom colour, like "brand", to the palette in TypeScript?

Add it to palette in createTheme, then use module augmentation to extend Palette and PaletteOptions. If you want <Button color="brand">, also augment ButtonPropsColorOverrides. Without augmentation, TypeScript rejects the new key even though it works at runtime.

Q19. How would you share one MUI theme across several apps?

Put the theme, custom variants and type augmentations in a small internal package (for example @company/ui-theme) and publish it to your registry or keep it in a monorepo. Every app imports the same theme, so a colour change ships everywhere through a version bump. Keep the MUI version as a peer dependency so apps don't end up with two copies of MUI.

4. Components, slots and forms

Q20. What are slots and slotProps?

Complex components are made of inner parts, or slots. For example, Autocomplete has a root, a popper, a listbox, and clear and popup indicators. slots lets you replace one of those inner parts with your own component, and slotProps lets you pass props to it. This replaced the older components and componentsProps API, which v9 removed. It's the standard way to customise internals without rebuilding the component.

Q21. How does the Grid component work in recent versions?

Since v7, the default Grid is the newer implementation (previously called Grid v2). It uses CSS flexbox with a container and a size prop on children, for example size={{ xs: 12, md: 6 }}. The old item/xs prop style lives on as GridLegacy for migration. For simple one-direction layouts, Stack is often clearer than Grid.

Q22. How do you use MUI TextField with React Hook Form?

Wrap it in React Hook Form's Controller (or useController) so the form library controls value and onChange. Pass fieldState.error to error and the message to helperText. Registering an uncontrolled input with register also works for a plain TextField. For Autocomplete, Select and date pickers, Controller is the safer choice because their onChange signatures differ from a native input.

Q23. Autocomplete has both value and inputValue. What's the difference?

value is the selected option (an object or a list of objects). inputValue is the text currently typed in the box. They are controlled separately on purpose: a user can type "Del" while the selected value is still "Mumbai". For server-side search you usually control inputValue, debounce it, fetch options, and set filterOptions={(x) => x} so MUI doesn't filter the server results a second time.

Q24. What accessibility work does MUI do for you, and what is still your job?

MUI components handle roles, keyboard navigation, focus management and ARIA attributes. For example, Dialog traps focus and restores it when it closes, and Menu and Tabs use roving tabindex, which was improved in v9. It's still your job to provide labels (such as aria-labelledby for a Dialog or a label on every TextField), to keep colour contrast passing in your custom theme, and not to break semantics by turning everything into a div with onClick.

Q25. How do you test MUI components?

Use React Testing Library and query by role and accessible name: getByRole('button', { name: /save/i }), getByRole('combobox') for Autocomplete, and getByRole('dialog'). Avoid querying by MUI class names, because they are implementation details. For portaled elements like menus and poppers, the queries still work through screen, since they search the whole document.

5. Performance, SSR and architecture

Q26. How do you keep an MUI app's bundle small?

  • Use named imports from @mui/material; modern bundlers tree-shake them in production.
  • In development, path imports such as @mui/material/Button can speed up builds in some setups.
  • Import icons one by one, never the whole icons package.
  • Lazy-load heavy screens that use DataGrid or date pickers.
  • Check the result with a bundle analyser instead of guessing.

Q27. How do you set up MUI with the Next.js App Router?

Emotion needs to collect styles during server rendering. MUI ships @mui/material-nextjs, whose AppRouterCacheProvider wraps the app in the root layout and handles style collection and injection order. The ThemeProvider lives in a small client component, because context providers need 'use client'. Server Components can still render MUI components, but anything that uses hooks or event handlers must be a client component.

Q28. A table with 2,000 rows built from MUI components is slow. What do you check?

First, profile with React DevTools to see whether it's render cost or style cost. Common fixes: virtualise the rows (MUI X DataGrid does this for you), replace per-row sx objects with a styled() row component, memoise row components so one change doesn't re-render all rows, and avoid passing new inline functions or objects to every row.

Q29. MUI, Chakra UI or Tailwind: how would you choose?

MUI gives you the largest set of finished components, including complex ones like DataGrid and date pickers, and a mature theming system. That makes it a strong fit for dashboards and internal tools. Chakra UI is lighter, built on accessible primitives, and nice for product UIs with a custom look. Tailwind is a styling approach, not a component library, so you pair it with headless components (like Base UI) and build the visuals yourself. A good answer ties the choice to the product, team skills and design freedom rather than declaring one "best". Our Chakra UI interview questions cover the other side of this comparison.

Q30. How would you migrate a large app from MUI v5 to the latest version?

Go one major at a time and read each migration guide. Run MUI's codemods where they exist, fix deprecation warnings before upgrading (they become hard breaks later, as componentsProps did in v9), and move to slots/slotProps and the new Grid early. Upgrade on a branch with visual regression tests or screenshots of key screens, because theme and style changes show up as visual bugs, not test failures.

How to prepare

  • Build one themed mini-app. A login screen, a dashboard card grid and a dialog form with dark mode will cover half of these questions in practice.
  • Know the styling decision. Be ready to explain when you choose sx, styled() or theme overrides, with one example of each.
  • Read the latest release notes. Mentioning v9 changes (slots only, NumberField, Menubar, Emotion still in use) shows you keep up to date.
  • Revise React itself. Most MUI follow-ups turn into React questions about re-renders, context and controlled inputs. Our 40 React interview questions cover those.
  • Practise with timed MCQs from the links below to find gaps quickly.

FAQ

Is Material UI still worth learning in 2026?

Yes. It's one of the most widely used React component libraries, especially for admin panels, dashboards and enterprise apps, and many job descriptions list it by name. Learn React and CSS fundamentals first, then MUI, so you understand what the library is doing for you.

Is MUI the same as Material UI?

MUI is the company and the umbrella brand. Material UI is its main React library. MUI also makes MUI X (DataGrid, date pickers, charts) and Base UI (unstyled components).

Do I need to know MUI X for an interview?

Only if the role uses it. Knowing that DataGrid exists, supports virtualisation, sorting, filtering and server-side data, and that some features need a paid licence is usually enough unless the job is a data-heavy dashboard.

Which version of Material UI should I mention?

Say which version you've used in production and that you know the current one is v9 (released April 2026). Interviewers care more that you understand migrations and deprecations than about the exact number.

Preparing for frontend interviews with others? Join the CodingHumans WhatsApp community for new question sets and practice tests.

Comments

Answered 0/0Correct 0