{"id":1420,"date":"2026-07-10T18:18:48","date_gmt":"2026-07-10T11:18:48","guid":{"rendered":"https:\/\/sumberlaba.com\/index.php\/2026\/07\/10\/how-to-use-mantine-for-building-beautiful-react-components-a-practical-guide\/"},"modified":"2026-07-10T18:18:48","modified_gmt":"2026-07-10T11:18:48","slug":"how-to-use-mantine-for-building-beautiful-react-components-a-practical-guide","status":"publish","type":"post","link":"https:\/\/sumberlaba.com\/index.php\/2026\/07\/10\/how-to-use-mantine-for-building-beautiful-react-components-a-practical-guide\/","title":{"rendered":"How to Use Mantine for Building Beautiful React Components: A Practical Guide"},"content":{"rendered":"<h1>How to Use Mantine for Building Beautiful React Components: A Practical Guide<\/h1>\n<p>Mantine is a modern React component library that offers 100+ customizable components and hooks, built with accessibility and dark mode in mind. It uses CSS-in-JS (Emotion) for styling, making it easy to integrate into any React project. Whether you need forms, modals, notifications, or data tables, Mantine provides a polished, production-ready solution with minimal boilerplate.<\/p>\n<p>To get started, install the core package and its dependencies: <code>npm install @mantine\/core @mantine\/hooks @mantine\/notifications @mantine\/form<\/code>. Then add the MantineProvider wrapping your app (usually in <code>index.js<\/code>) to enable themes and global styles. You can choose a default theme or customize colors, spacing, and typography via the <code>theme<\/code> prop.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/via.placeholder.com\/800x600\/4a90d9\/ffffff?text=how%20to%20use%20Mantine%20for%20React%20components\" alt=\"Article illustration\" style=\"display:block;margin:20px auto;max-width:100%;height:auto;border-radius:8px;\" \/><\/p>\n<h2>Essential Components to Use<\/h2>\n<h3>Buttons and Inputs<\/h3>\n<p>Mantine\u2019s <code>Button<\/code> supports variants (filled, outline, light) and sizes. Use <code>TextInput<\/code> with built-in validation via <code>@mantine\/form<\/code>. Example:<\/p>\n<ul>\n<li><code>&lt;Button variant=\"filled\" color=\"blue\"&gt;Submit&lt;\/Button&gt;<\/code><\/li>\n<li><code>&lt;TextInput label=\"Name\" required \/&gt;<\/code><\/li>\n<\/ul>\n<h3>Modals and Drawers<\/h3>\n<p>Modals require a state hook. Use <code>useDisclosure<\/code> from <code>@mantine\/hooks<\/code> to control open\/close. Example:<\/p>\n<ul>\n<li>Define <code>const [opened, { open, close }] = useDisclosure(false)<\/code><\/li>\n<li>Render <code>&lt;Modal opened={opened} onClose={close} title=\"Hello\"&gt;Content&lt;\/Modal&gt;<\/code><\/li>\n<\/ul>\n<h2>Customizing with Theme<\/h2>\n<p>Override the default theme by passing a <code>theme<\/code> object to <code>MantineProvider<\/code>. Change primary color, font family, border radius, or add dark mode with <code>colorScheme=\"dark\"<\/code>. Example:<\/p>\n<ul>\n<li><code>&lt;MantineProvider theme={{ primaryColor: 'teal', defaultRadius: 'lg' }}&gt;<\/code><\/li>\n<\/ul>\n<p>Mantine also includes hooks like <code>useMediaQuery<\/code> for responsive design and <code>useLocalStorage<\/code> for persisting state. With its excellent documentation and TypeScript support, Mantine is an excellent choice for building consistent, beautiful React interfaces quickly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Use Mantine for Building Beautiful React Components: A Practical Guide Mantine is a modern React component library that offers 100+ customizable components and hooks, built with accessibility and dark mode in mind. It uses CSS-in-JS (Emotion) for styling, making it easy to integrate into any React project. Whether you need forms, modals, notifications, &hellip; <\/p>\n","protected":false},"author":2716,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-1420","post","type-post","status-publish","format-standard","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/users\/2716"}],"replies":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/comments?post=1420"}],"version-history":[{"count":0,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1420\/revisions"}],"wp:attachment":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/media?parent=1420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/categories?post=1420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/tags?post=1420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}