Chakra UI Interview Questions and Answers: Top 25 (2026)

Chakra UI interview questions and answers 2026 - CodingHumans

Chakra UI interview questions have changed a lot since Chakra UI v3. If your last Chakra project used extendTheme, isDisabled and framer-motion, an interviewer can catch you out in the first five minutes. Version 3 rebuilt the library on Ark UI, moved to compound components and a new theming system, and in 2026 it kept adding components such as a date picker, a marquee and a rich text editor.

Here are 25 questions that cover what interviewers actually ask: the v2 to v3 changes, theming with tokens and recipes, accessibility, forms, Next.js and when to pick Chakra at all. Each answer explains the reason behind it, so you can handle the follow-up.

1. Basics and v3 changes

Q1. What is Chakra UI?

Chakra UI is an open-source React component library focused on accessibility and developer speed. You build layouts with components like Box, Flex, Stack and Grid, and you style them with style props such as p, bg and borderRadius instead of writing separate CSS files. It's popular for product UIs and SaaS dashboards that need a custom look rather than a Material Design look.

Q2. What changed in Chakra UI v3 compared with v2?

The big changes, which Chakra announced in October 2024:

  • Components are built on Ark UI, which uses state machines for component logic such as open and close or keyboard handling.
  • Many components became compound components: List.Root and List.Item, Dialog.Root and Dialog.Content.
  • extendTheme was replaced by createSystem(defaultConfig, config).
  • framer-motion is no longer a dependency; animations use plain CSS.
  • Boolean props lost the is prefix (isDisabled became disabled), and Stack uses gap instead of spacing.
  • The separate icons package was dropped; you use lucide-react or react-icons.
  • Over 25 new components arrived, including File Upload, Clipboard, Timeline, Password Input and Segmented Control.

Q3. What do you install for a Chakra UI v3 project?

@chakra-ui/react and @emotion/react. Emotion is still the runtime styling engine. You no longer install @emotion/styled or framer-motion as v2 required. Then you usually run the Chakra CLI to add the provider snippet to your project.

Q4. What are Chakra "snippets", and why does v3 use them?

Snippets are pre-built component files that the CLI copies into your project, usually under components/ui, for example with npx @chakra-ui/cli snippet add button. The Provider, Toaster and color-mode helpers come as snippets too. The idea is similar to shadcn/ui: the code lives in your repo, so you can change it freely instead of fighting a black-box component. The trade-off is that you also own updates to those files.

Q5. What does the Provider snippet set up?

It wraps your app in ChakraProvider with your theme system, and in ThemeProvider from next-themes, which handles light and dark mode. That's a change from v2, where color mode was built into Chakra itself.

Q6. Why did Chakra build v3 on Ark UI?

Component behaviour, like focus trapping in a dialog, roving focus in a menu or typeahead in a select, is hard to get right and easy to break. Ark UI moves that logic into tested state machines that work across frameworks. Chakra then focuses on styling and the developer API on top. For you, that means more consistent keyboard and screen reader behaviour across components.

2. Style props and responsive design

Q7. What are style props, and how are they different from inline styles?

Style props like <Box p="4" bg="blue.500" /> look like inline styles but are converted to real CSS classes. Unlike the style attribute, they read values from your theme tokens, support pseudo-states (_hover, _focus), and support responsive values. They also keep spacing and colours consistent, because p="4" refers to a spacing token, not a random pixel value.

Q8. How do responsive styles work?

Chakra is mobile-first. You pass an object with breakpoint keys, such as fontSize={{ base: 'sm', md: 'lg' }}, or an array in breakpoint order. base applies to all sizes, and md kicks in from the medium breakpoint upward. Prefer this over JavaScript checks of window width, because CSS responsiveness avoids re-renders and works during server rendering.

Q9. What are pseudo props and conditions?

Props that start with an underscore apply styles in a condition: _hover, _focusVisible, _disabled, _dark and more. For example, _dark={{ bg: 'gray.800' }} changes the background only in dark mode. You can define custom conditions in the theme config when the built-in ones aren't enough.

Q10. What is the asChild prop?

asChild tells a Chakra component not to render its own element but to pass its props and behaviour to its single child. A common case is wrapping a router link: <Button asChild><a href="/pricing">Pricing</a></Button> gives you a real link that looks like a button. Without asChild you'd get a link inside a button, which is invalid HTML and confusing for keyboard users.

3. Theming: tokens, recipes and color mode

Q11. How do you create a custom theme in v3?

You merge your config into the default config and create a system:

const config = defineConfig({
  theme: {
    tokens: {
      colors: { brand: { 500: { value: '#3B37B0' } } },
    },
  },
});
export const system = createSystem(defaultConfig, config);

Then you pass system to ChakraProvider, which the Provider snippet does for you.

Q12. What is the difference between tokens and semantic tokens?

Tokens are raw values, like blue.500 or a spacing of 4. Semantic tokens describe purpose, like bg.muted, fg.error or border.subtle, and can point to different raw tokens in light and dark mode. Components should use semantic tokens. Then a rebrand or a new dark palette means changing the mapping in one place, not editing hundreds of components.

Q13. What does the colorPalette prop do?

It switches a component's whole colour scheme at once. <Button colorPalette="red"> uses the red palette for background, hover and focus ring, because the component's styles are written against the current palette rather than a fixed colour. It replaces v2's colorScheme prop and also works on layout boxes, so child components can inherit it.

Q14. What are recipes and slot recipes?

A recipe defines a component's base styles plus its variants, such as size and variant, in one object. You create it with defineRecipe. A slot recipe does the same for multi-part components such as a card with header, body and footer, using defineSlotRecipe. Recipes keep variant logic out of your JSX and make the design system easy to read: you see every allowed variant in one file.

Q15. How does dark mode work in v3?

Color mode is handled by next-themes through the color-mode snippet, which gives you a hook and a toggle button. Chakra styles react to the class on the root element, and semantic tokens switch values automatically. To avoid a flash of the wrong theme on server-rendered pages, add suppressHydrationWarning on the html element, as the docs recommend.

Q16. How do you get TypeScript autocompletion for your custom tokens?

Run the Chakra CLI's typegen command against your theme file. It generates types for your tokens, recipes and conditions, so bg="brand.500" autocompletes and typos are caught at compile time. Re-run it whenever you change the theme, or add it to a script in package.json.

4. Components, forms and accessibility

Q17. Why does v3 use compound components like Dialog.Root and Dialog.Content?

Compound components give you control over structure and placement. Instead of one Modal with a dozen props, you compose Dialog.Root, Dialog.Trigger, Dialog.Backdrop, Dialog.Content, Dialog.Header and so on. Each part can be styled or replaced, and the parts share state through context. It's more verbose, which is why Chakra also offers snippet wrappers for common cases.

Q18. How do you control a Dialog's open state from outside?

Pass open and onOpenChange to Dialog.Root. onOpenChange receives details with the new open value, and you store it in state. This controlled pattern is needed when something other than the trigger opens the dialog, for example a failed API call or a keyboard shortcut.

Q19. How do you build an accessible form field?

Use the Field parts: Field.Root with invalid and required, Field.Label, your input, Field.HelperText and Field.ErrorText. Field.Root wires up id, aria-describedby and aria-invalid automatically, so screen readers announce the label and the error. With React Hook Form, you pass errors.email to invalid and the message to Field.ErrorText.

Q20. What accessibility features does Chakra give you, and what remains your job?

Through Ark UI you get focus management, keyboard navigation, ARIA roles and states for menus, dialogs, tabs and selects. You still need to provide text alternatives (labels, aria-label on icon-only buttons), keep colour contrast passing in your custom palette, and use the right element: asChild with a real link for navigation, a button for actions.

Q21. What components were added to Chakra in 2026?

Chakra's Q1 2026 recap lists a Rich Text Editor built on Tiptap (v3.31), a Marquee component (v3.32), and a DatePicker plus a standalone Calendar (v3.34). The DatePicker supports range selection, unavailable dates, min/max and locale-aware formatting. Mentioning these shows you follow the project, but interviewers care more that you know how to evaluate a new component than that you list them.

5. Migration, Next.js and trade-offs

Q22. How would you migrate a large app from Chakra v2 to v3?

Start with the official codemod: npx @chakra-ui/codemod upgrade, which has over 50 transforms. Run it with --dry first to preview the changes. Then handle what codemods can't: rewrite extendTheme into createSystem, replace framer-motion-based animations, move color mode to next-themes, and rebuild modals and menus as compound components. Migrate screen by screen on a branch, with visual checks, because most breakages are visual.

Q23. How do you use Chakra UI with the Next.js App Router?

The Provider uses context and runs in the browser, so it lives in a client component (marked 'use client') that you render inside the root layout. Server Components can render simple Chakra layout components, but anything with hooks, event handlers or open/close state must be a client component. Add suppressHydrationWarning to <html> for color mode.

Q24. What are the performance trade-offs of Chakra UI?

Style props are processed at runtime by Emotion, so very large lists with many styled elements cost more than static CSS. You reduce this by moving repeated styles into recipes, keeping style objects stable, and virtualising long lists. For most product screens the cost isn't noticeable, and the speed of building and the built-in accessibility usually outweigh it.

Q25. Chakra UI or Material UI: how do you choose?

Choose Chakra when you want a custom-looking product UI, fast layout building with style props, and accessible primitives. Choose Material UI when you need a large catalogue of finished components, especially data grids and date pickers for dashboards, or when the product follows Material Design. Both are mature. The best answer ties the choice to the product and the team, not to personal taste. Our Material UI interview questions cover the MUI side in detail.

How to prepare

  • Build a small v3 app from scratch. Set up the Provider snippet, a custom brand token, a semantic token for dark mode, one recipe with two variants, and a Dialog with a form.
  • Know the v2 to v3 renames by heart. extendTheme to createSystem, isDisabled to disabled, colorScheme to colorPalette, spacing to gap.
  • Explain the "why" of compound components and asChild. These come up often because they test React composition, not just Chakra.
  • Revise React fundamentals. Follow-ups usually move to context, controlled components and re-renders. Start with our React interview questions.

FAQ

Is Chakra UI still maintained in 2026?

Yes. Chakra shipped regular 3.x releases through early 2026, including the DatePicker in v3.34, and publishes quarterly recaps on its blog.

Should I learn Chakra UI v2 or v3?

Learn v3. New projects use it, and many v2 apps are migrating. If a job uses v2, the concepts (style props, tokens, accessible components) carry over, and you can pick up the old API quickly.

Does Chakra UI work with Tailwind CSS?

You can use both in one project, but they solve the same styling problem in different ways, so most teams pick one. Mixing them makes styles harder to reason about.

Is Chakra UI good for beginners?

Yes, if you already know basic React and CSS. Style props make layouts quick to build, but learn plain CSS flexbox and grid first so you understand what Flex and Grid do underneath.

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

Comments

Answered 0/0Correct 0