Mui dark theme
Author: d | 2025-04-24
Material UI dark / light theme with Nextjs. nextjs mui dark-light-mode mui-theme. Updated ; TypeScript; adyfk / mui-theme-simulation. Star 0. Add a description MUI - dark theme doesn't change anything. Related. 31. Material UI dark theme isn't applied to the background. 7. Applying type: 'dark' to a MUI palette breaks my site unless
Light Dark theme MUI - Codesandbox
Modern and clean mui TemplateSlim - a free and open source React dashboard template made using Material UI React component library with aim of flexibility and better customizability.Modern & Clean Responsive MUI Material-ui Admin Dashboard Template. It is fully responsive.It can be used for most type of dashboard and app templates like analytics, admin or messenger app for your desktop or mobile applications. Amazing flexibility and reusability. 85+ Demo pages ⭐ ⭐ ⭐ Do not forget to star (Top right of this page) it if you like the theme ⭐ ⭐ ⭐Support React18.Professional user interface.Material UI React components.Fully responsive, all modern browser supported.Easy to use code & folder structure.Flexible & high-Performance codeHundreds of customized MUI components.Pre-build useful pages & Apps.Dark & light modeFree SLIM MUI React js versionComplete Version PreviewClean Version PreviewVersion with only components, styles, theme and sample pageDownload from GithubGetting StartedClone from Githubgit clone StackMaterial UI V5React 18Built with React Hooks APIRedux & React Context API for State ManagementReact Router for Navigation RoutingViteCode SplittingAliasesLight/Dark theme supportEslint - airbnb style guideApexChartsIssuesTo report a bug, please submit an issue on Github. We will respond as soon as possible to resolve the issue.RoadmapPrioritiesMore components!More PagesBetter customizationBetter documentationPerformanceBundle sizeIn futureUser issues & supportTypescript versionNext/CRA/Remix versionsAccessibility.Color PresetsWe use different colorsChangelogFolder Structure Package json file.├── public├── README.md├── src│ ├── _mocks -> Mock Json data to be used for working apps│ ├── assets│ │ ├── images│ │ ├── css -> Template css files│ │ │ ├── style.css -> Application main css file│ ├── components│ │ React Dashboard App This is an admin dashboard application with many charts and pages created using ReactJS, TailwindCSS, MUI X (for charts), PrimeReact (for datatables and other components), and Chakra UI (for tooltips)It is based on this tutorial, with using MUI X instead of SyncFusion (because MUI X is free)Technical HighlightsTailwind CSSFor basic installation and usage, see this repoThe addition here is adding custom styles in TailwindCSS (e.g. background colors)To do this:In tailwind.config.js add the needed attributes under the extend section extend: { fontSize: { 14: '14px', }, backgroundColor: { 'main-bg': '#FAFBFB', 'main-dark-bg': '#20232A', 'secondary-dark-bg': '#33373E', 'light-gray': '#F7F7F7', 'half-transparent': 'rgba(0, 0, 0, 0.5)', },To use the style in the app, simply add the className (e.g. bg-main-bg)ContextThe application state is stored using useContext hook in React. See ContextProvider.jsComponentsDatatablesSee ReactPrime DataTable and the examples in Orders.jsx and Employees.jsx and Customers.jsxInstall it using npmAdd its imports and CSS includesimport { DataTable } from "primereact/datatable";import { Column } from "primereact/column";import "primereact/resources/themes/lara-light-indigo/theme.css";Use it {ordersGrid.map((column) => ( ))}"> {ordersGrid.map((column) => ( ))}Add some options (like sorting by columns in Orders.jsx or global search in Employees.jsx or editing and selecting in Customers.jsx)ChartsLine chart: see MUI X line chart">Sparkline chart: see MUI X Sparkline chart and Ecommerce.jsx">Stacked bar chart: see MUI X Bar chart and Ecommerce.jsx">SidebarAn elegant sidebar in React is added where the navigation is done using NavLink from react-router-dom. See Sidebar.jsxResponsive, closes automatically on small screensNavbarAn elegant navbar in React is added using icons. See Navbar.jsxTheme SettingA side menu is opened for the user to choose the application theme when settings is clicked. See ThemeSettings.jsx.Implementation is done in the ContextProvide and stored in localStorage. See ContextProvider.jsUsage: see the usage of currentColor and currentModeWYSWYG EditorAdded based on PrimeReact which uses QuiliJS. See EditorComp.jsxColor PickerSwatchesPicker and SketchPicker are added based on react-color. See ColorPicker.jsxKanban ChartA Kanban chart is added in Kanban.jsx based on this repoSupport Light Dark Theme with NextJs MUI
Skip to content Navigation Menu GitHub Copilot Write better code with AI Security Find and fix vulnerabilities Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes Discussions Collaborate outside of code Code Search Find more, search less Explore Learning Pathways Events & Webinars Ebooks & Whitepapers Customer Stories Partners Executive Insights GitHub Sponsors Fund open source developers The ReadME Project GitHub community articles Enterprise platform AI-powered developer platform Pricing Provide feedback Saved searches Use saved searches to filter your results more quickly //voltron/issues_fragments/issue_layout;ref_cta:Sign up;ref_loc:header logged out"}"> Sign up Notifications You must be signed in to change notification settings Fork 1.4k Star 4.7k DescriptionCurrent behavior 😯In dark mode, the background of the pinned columns is gray, and although it may work better in "blacker" backgrounds, it doesn't really match the theme we use in our demos.Expected behavior 🤔A different style to display pinned columns that better match different dark themes.Steps to reproduce 🕹Link to live example:Steps: your settings to display in dark modeContext 🔦No responseYour environment 🌎 npx @mui/envinfo Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here.Order ID 💳 (optional)No response. Material UI dark / light theme with Nextjs. nextjs mui dark-light-mode mui-theme. Updated ; TypeScript; adyfk / mui-theme-simulation. Star 0. Add a description[AppBar] Make dark by default for dark themes Issue mui
The Data Grid allows to support users from different locales, with formatting, RTL, and localized strings.The default locale of Material-UI is English (United States). If you want to use other locales, follow the instructions below.Translation keysYou can use the localeText prop to pass in your own text and translations.You can find all the translation keys supported in the source in the GitHub repository.In the following example, the labels of the density selector are customized.Locale textThe default locale of Material-UI is English (United States).You can use the theme to configure the locale text:import { createTheme, ThemeProvider } from '@material-ui/core/styles';import { DataGrid, bgBG } from '@mui/x-data-grid';const theme = createTheme( { palette: { primary: { main: '#1976d2' }, }, }, bgBG,);ThemeProvider theme={theme}> DataGrid />ThemeProvider>;Note that createTheme accepts any number of arguments.If you are already using the translations of the core components, you can add bgBG as a new argument.The same import works for DataGridPro as it's an extension of DataGrid.import { createTheme, ThemeProvider } from '@material-ui/core/styles';import { DataGrid, bgBG } from '@mui/x-data-grid';import { bgBG as coreBgBG } from '@material-ui/core/locale';const theme = createTheme( { palette: { primary: { main: '#1976d2' }, }, }, bgBG, coreBgBG,);ThemeProvider theme={theme}> DataGrid />ThemeProvider>;If you want to pass language translations directly to the grid without using createTheme and ThemeProvider, you can directly load the language translations from the @mui/x-data-grid or @mui/x-data-grid-pro package.import { DataGrid, nlNL } from '@mui/x-data-grid';DataGrid localeText={nlNL.props.MuiDataGrid.localeText} />;Supported localesLocaleBCP 47 language tagImport nameArabic (Sudan)ar-SDarSDBulgarianbg-BGbgBGCzechcs-CZcsCZDutchnl-NLnlNLEnglish (United States)en-USenUSFrenchfr-FRfrFRGermande-DEdeDEGreekel-GRelGRItalianit-ITitITJapaneseja-JPjaJPPolishpl-PLplPLPortuguese (Brazil)pt-BRptBRRussianru-RUruRUSlovaksk-SKskSKSpanish (Spain)es-ESesESTurkishtr-TRtrTRUkraineuk-UAukUAYou can find the source in the GitHub repository.To create your own translation or to customize the English text, copy this file to your project, make any changes needed and import the locale from there.Please do consider contributing new translations back to Material-UI by opening a pull request. However, Material-UI aims to support the 100 most popular locales. We might not accept contributions for locales that are not frequently used, for instance, gl-ES that has "only" 2.5 million native speakers.See the Docs for more details.APIDataGridDataGridPro The variant prop. const StatRoot = styled('div', { name: 'MuiStat', slot: 'root',- })(({ theme }) => ({+ })(({ theme, ownerState }) => ({ display: 'flex', flexDirection: 'column', gap: theme.spacing(0.5), padding: theme.spacing(3, 4), backgroundColor: theme.palette.background.paper, borderRadius: theme.shape.borderRadius, boxShadow: theme.shadows[2], letterSpacing: '-0.025em', fontWeight: 600,+ ...ownerState.variant === 'outlined' && {+ border: `2px solid ${theme.palette.divider}`,+ }, }));4. Support theme default propsTo customize your component's default props for different projects, you need to use the useThemeProps API.+ import { useThemeProps } from '@mui/material/styles';- const Stat = React.forwardRef(function Stat(props, ref) {+ const Stat = React.forwardRef(function Stat(inProps, ref) {+ const props = useThemeProps({ props: inProps, name: 'MuiStat' }); const { value, unit, ...other } = props; return ( {value} {unit} ); });Then you can customize the default props of your component like this:import { createTheme } from '@mui/material/styles';const theme = createTheme({ components: { MuiStat: { defaultProps: { variant: 'outlined', }, }, },});TypeScriptIf you use TypeScript, you must create interfaces for the component props and ownerState:interface StatProps { value: number | string; unit: string; variant?: 'outlined';}interface StatOwnerState extends StatProps { // …key value pairs for the internal state that you want to style the slot // but don't want to expose to the users}Then you can use them in the component and slots.const StatRoot = styled('div', { name: 'MuiStat', slot: 'root',}){ ownerState: StatOwnerState }>(({ theme, ownerState }) => ({ display: 'flex', flexDirection: 'column', gap: theme.spacing(0.5), padding: theme.spacing(3, 4), backgroundColor: theme.palette.background.paper, borderRadius: theme.shape.borderRadius, boxShadow: theme.shadows[2], letterSpacing: '-0.025em', fontWeight: 600, // typed-safe access to the `variant` prop ...(ownerState.variant === 'outlined' && { border: `2px solid ${theme.palette.divider}`, boxShadow: 'none', }),}));// …do the same for other slotsconst Stat = React.forwardRefHTMLDivElement, StatProps>(function Stat(inProps, ref) { const props = useThemeProps({ props: inProps, name: 'MuiStat' }); const { value, unit, variant, ...other } = props; const ownerState = { ...props, variant }; return ( StatRoot ref={ref} ownerState={ownerState} {...other}> StatValue ownerState={ownerState}>{value}StatValue> StatUnit ownerState={ownerState}>{unit}StatUnit> StatRoot> );});Finally, add the Stat component to the theme types.import { ComponentsOverrides, ComponentsVariants, Theme as MuiTheme,} from '@mui/material/styles';import { StatProps } from 'path/to/Stat';type Theme = OmitMuiTheme, 'components'>;declare module '@mui/material/styles' { interface ComponentNameToClassKey { MuiStat: 'root' | 'value' | 'unit'; } interface ComponentsPropsList { MuiStat: PartialStatProps>; } interface Components { MuiStat?: { defaultProps?: ComponentsPropsList['MuiStat']; styleOverrides?: ComponentsOverridesTheme>['MuiStat']; variants?: ComponentsVariants['MuiStat']; }; }}TemplateThis template is the final product of the step-by-step guide above, demonstrating how to build a custom component that can be styled with the theme as if it was a built-in component.Problem with MUI dark theme : r/learnreactjs - Reddit
A fast and extendable library of react chart components for data visualization.FeedbackBundle sizeOverviewThe @mui/x-charts is an MIT library for rendering charts relying on D3.js for data manipulation and SVG for rendering.And, like other MUI X components, charts are production-ready components that integrate smoothly into your app.With a high level of customization, MUI X Charts provides three levels of customization layers: single components with great defaults, extensive configuration props, and subcomponents for flexible composition.Additionally, you can also use all the MUI System tools, such as the theme override or the sx prop.Press Enter to start editingUsing the documentationThe MUI X Charts documentation has a slightly different structure than other MUI X components.Instead of having a long page for each, the pages are divided in two:General description of the built-in features the component provides.A set of examples demonstrating the component with customizations.All MUI X Charts componentsSupported featuresThe features that are shared across multiple Charts components, such as axes and legends, are also documented on separate pages.How to increase contrast for MUI dark theme for modals
Learn how to create fully custom components that accept your app's theme.IntroductionMaterial UI provides a powerful theming feature that lets you add your own components to the theme and treat them as if they're built-in components.If you are building a component library on top of Material UI, you can follow the step-by-step guide below to create a custom component that is themeable across multiple projects.Alternatively, you can use the provided template as a starting point for your component.Step-by-step guideThis guide will walk you through how to build this statistics component, which accepts the app's theme as though it were a built-in Material UI component:1. Create the component slotsSlots let you customize each individual element of the component by targeting its respective name in the theme's styleOverrides and theme's variants.This statistics component is composed of three slots:root: the container of the componentvalue: the number of the statisticsunit: the unit or description of the statisticsUse the styled API with name and slot parameters to create the slots, as shown below:import * as React from 'react';import { styled } from '@mui/material/styles';const StatRoot = styled('div', { name: 'MuiStat', // The component name slot: 'root', // The slot name})(({ theme }) => ({ display: 'flex', flexDirection: 'column', gap: theme.spacing(0.5), padding: theme.spacing(3, 4), backgroundColor: theme.palette.background.paper, borderRadius: theme.shape.borderRadius, boxShadow: theme.shadows[2], letterSpacing: '-0.025em', fontWeight: 600,}));const StatValue = styled('div', { name: 'MuiStat', slot: 'value',})(({ theme }) => ({ ...theme.typography.h3,}));const StatUnit = styled('div', { name: 'MuiStat', slot: 'unit',})(({ theme }) => ({ ...theme.typography.body2, color: theme.palette.text.secondary,}));2. Create the componentAssemble the component using the slots created in the previous step:// /path/to/Stat.jsimport * as React from 'react';const StatRoot = styled('div', { name: 'MuiStat', slot: 'root',})(…);const StatValue = styled('div', { name: 'MuiStat', slot: 'value',})(…);const StatUnit = styled('div', { name: 'MuiStat', slot: 'unit',})(…);const Stat = React.forwardRef(function Stat(props, ref) { const { value, unit, ...other } = props; return ( StatRoot ref={ref} {...other}> StatValue>{value}StatValue> StatUnit>{unit}StatUnit> StatRoot> );});export default Stat;At this point, you'll be able to apply the theme to the Stat component like this:import { createTheme } from '@mui/material/styles';const theme = createTheme({ components: { // the component name defined in the `name` parameter // of the `styled` API MuiStat: { styleOverrides: { // the slot name defined in the `slot` and `overridesResolver` parameters // of the `styled` API root: { backgroundColor: '#121212', }, value: { color: '#fff', }, unit: { color: '#888', }, }, }, },});3. Style the slot with ownerStateWhen you need to style the slot-based props or internal state, wrap them in the ownerState object and pass it to each slot as a prop.The ownerState is a special name that will not spread to the DOM via the styled API.Add a variant prop to the Stat component and use it to style the root slot, as shown below: const Stat = React.forwardRef(function Stat(props, ref) {+ const { value, unit, variant, ...other } = props;++ const ownerState = { ...props, variant }; return (- - {value}- {unit}- + + {value}+ {unit}+ ); });Then you can read ownerState in the slot to style it based on. Material UI dark / light theme with Nextjs. nextjs mui dark-light-mode mui-theme. Updated ; TypeScript; adyfk / mui-theme-simulation. Star 0. Add a description[Alert] Improve coloring for dark theme Issue mui
API reference docs for the React Chip component. Learn about the props, CSS, and other APIs of this exported module.DemosImportimport Chip from '@mui/joy/Chip';// orimport { Chip } from '@mui/joy';Learn about the difference by reading this guide on minimizing bundle size.Chips represent complex entities in small blocks, such as a contact.Props of the native component are also available.NameTypeDefaultDescriptionchildrennode-The content of the component.color'danger'| 'neutral'| 'primary'| 'success'| 'warning'| string'neutral'The color of the component. It supports those theme colors that make sense for this component.To learn how to add your own colors, check out Themed components—Extend colors.componentelementType-The component used for the root node. Either a string to use a HTML element or a component.disabledboolfalseIf true, the component is disabled.endDecoratornode-Element placed after the children.onClickfunc-Element action click handler.size'lg'| 'md'| 'sm'| string'md'The size of the component. It accepts theme values between 'sm' and 'lg'.To learn how to add custom sizes to the component, check out Themed components—Extend sizes.slotProps{ action?: func| object, endDecorator?: func| object, label?: func| object, root?: func| object, startDecorator?: func| object }{}The props used for each slot inside.slots{ action?: elementType, endDecorator?: elementType, label?: elementType, root?: elementType, startDecorator?: elementType }{}The components used for each slot inside.See Slots API below for more details.startDecoratornode-Element placed before the children.sxArray| object| bool>| func| object-The system prop that allows defining system overrides as well as additional CSS styles.See the `sx` page for more details.variant'outlined'| 'plain'| 'soft'| 'solid'| string'soft'The global variant to use.To learn how to add your own variants, check out Themed components—Extend variants.The ref is forwarded to the root element.Theme default propsYou can use JoyChip to change the default props of this component with the theme.To learn how to customize the slot, check out the Overriding component structure guide.Slot nameClass nameDefault componentDescriptionroot.MuiChip-root'div'The component that renders the root.label.MuiChip-label'span'The component that renders the label.action'button'The component that renders the action.startDecorator.MuiChip-startDecorator'span'The component that renders the start decorator.endDecorator.MuiChip-endDecorator'span'The component that renders the end decorator.These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.Class nameRule nameDescription.Mui-disabledState class applied to the root element if disabled={true}..Mui-focusVisibleState class applied to the root element if keyboard focused..MuiChip-colorContextcolorContextClass name applied to the root element when color inversion is triggered..MuiChip-colorDangercolorDangerClass name applied to the root element if color="danger"..MuiChip-colorNeutralcolorNeutralClass name applied to the root element if color="neutral"..MuiChip-colorPrimarycolorPrimaryClass name applied to the root element if color="primary"..MuiChip-colorSuccesscolorSuccessClass name applied to the root element if color="success"..MuiChip-colorWarningcolorWarningClass name applied to the root element if color="warning"..MuiChip-labelLglabelLgClass nameComments
Modern and clean mui TemplateSlim - a free and open source React dashboard template made using Material UI React component library with aim of flexibility and better customizability.Modern & Clean Responsive MUI Material-ui Admin Dashboard Template. It is fully responsive.It can be used for most type of dashboard and app templates like analytics, admin or messenger app for your desktop or mobile applications. Amazing flexibility and reusability. 85+ Demo pages ⭐ ⭐ ⭐ Do not forget to star (Top right of this page) it if you like the theme ⭐ ⭐ ⭐Support React18.Professional user interface.Material UI React components.Fully responsive, all modern browser supported.Easy to use code & folder structure.Flexible & high-Performance codeHundreds of customized MUI components.Pre-build useful pages & Apps.Dark & light modeFree SLIM MUI React js versionComplete Version PreviewClean Version PreviewVersion with only components, styles, theme and sample pageDownload from GithubGetting StartedClone from Githubgit clone StackMaterial UI V5React 18Built with React Hooks APIRedux & React Context API for State ManagementReact Router for Navigation RoutingViteCode SplittingAliasesLight/Dark theme supportEslint - airbnb style guideApexChartsIssuesTo report a bug, please submit an issue on Github. We will respond as soon as possible to resolve the issue.RoadmapPrioritiesMore components!More PagesBetter customizationBetter documentationPerformanceBundle sizeIn futureUser issues & supportTypescript versionNext/CRA/Remix versionsAccessibility.Color PresetsWe use different colorsChangelogFolder Structure Package json file.├── public├── README.md├── src│ ├── _mocks -> Mock Json data to be used for working apps│ ├── assets│ │ ├── images│ │ ├── css -> Template css files│ │ │ ├── style.css -> Application main css file│ ├── components│ │
2025-04-06React Dashboard App This is an admin dashboard application with many charts and pages created using ReactJS, TailwindCSS, MUI X (for charts), PrimeReact (for datatables and other components), and Chakra UI (for tooltips)It is based on this tutorial, with using MUI X instead of SyncFusion (because MUI X is free)Technical HighlightsTailwind CSSFor basic installation and usage, see this repoThe addition here is adding custom styles in TailwindCSS (e.g. background colors)To do this:In tailwind.config.js add the needed attributes under the extend section extend: { fontSize: { 14: '14px', }, backgroundColor: { 'main-bg': '#FAFBFB', 'main-dark-bg': '#20232A', 'secondary-dark-bg': '#33373E', 'light-gray': '#F7F7F7', 'half-transparent': 'rgba(0, 0, 0, 0.5)', },To use the style in the app, simply add the className (e.g. bg-main-bg)ContextThe application state is stored using useContext hook in React. See ContextProvider.jsComponentsDatatablesSee ReactPrime DataTable and the examples in Orders.jsx and Employees.jsx and Customers.jsxInstall it using npmAdd its imports and CSS includesimport { DataTable } from "primereact/datatable";import { Column } from "primereact/column";import "primereact/resources/themes/lara-light-indigo/theme.css";Use it {ordersGrid.map((column) => ( ))}"> {ordersGrid.map((column) => ( ))}Add some options (like sorting by columns in Orders.jsx or global search in Employees.jsx or editing and selecting in Customers.jsx)ChartsLine chart: see MUI X line chart">Sparkline chart: see MUI X Sparkline chart and Ecommerce.jsx">Stacked bar chart: see MUI X Bar chart and Ecommerce.jsx">SidebarAn elegant sidebar in React is added where the navigation is done using NavLink from react-router-dom. See Sidebar.jsxResponsive, closes automatically on small screensNavbarAn elegant navbar in React is added using icons. See Navbar.jsxTheme SettingA side menu is opened for the user to choose the application theme when settings is clicked. See ThemeSettings.jsx.Implementation is done in the ContextProvide and stored in localStorage. See ContextProvider.jsUsage: see the usage of currentColor and currentModeWYSWYG EditorAdded based on PrimeReact which uses QuiliJS. See EditorComp.jsxColor PickerSwatchesPicker and SketchPicker are added based on react-color. See ColorPicker.jsxKanban ChartA Kanban chart is added in Kanban.jsx based on this repo
2025-04-10Skip to content Navigation Menu GitHub Copilot Write better code with AI Security Find and fix vulnerabilities Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes Discussions Collaborate outside of code Code Search Find more, search less Explore Learning Pathways Events & Webinars Ebooks & Whitepapers Customer Stories Partners Executive Insights GitHub Sponsors Fund open source developers The ReadME Project GitHub community articles Enterprise platform AI-powered developer platform Pricing Provide feedback Saved searches Use saved searches to filter your results more quickly //voltron/issues_fragments/issue_layout;ref_cta:Sign up;ref_loc:header logged out"}"> Sign up Notifications You must be signed in to change notification settings Fork 1.4k Star 4.7k DescriptionCurrent behavior 😯In dark mode, the background of the pinned columns is gray, and although it may work better in "blacker" backgrounds, it doesn't really match the theme we use in our demos.Expected behavior 🤔A different style to display pinned columns that better match different dark themes.Steps to reproduce 🕹Link to live example:Steps: your settings to display in dark modeContext 🔦No responseYour environment 🌎 npx @mui/envinfo Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here.Order ID 💳 (optional)No response
2025-03-27The Data Grid allows to support users from different locales, with formatting, RTL, and localized strings.The default locale of Material-UI is English (United States). If you want to use other locales, follow the instructions below.Translation keysYou can use the localeText prop to pass in your own text and translations.You can find all the translation keys supported in the source in the GitHub repository.In the following example, the labels of the density selector are customized.Locale textThe default locale of Material-UI is English (United States).You can use the theme to configure the locale text:import { createTheme, ThemeProvider } from '@material-ui/core/styles';import { DataGrid, bgBG } from '@mui/x-data-grid';const theme = createTheme( { palette: { primary: { main: '#1976d2' }, }, }, bgBG,);ThemeProvider theme={theme}> DataGrid />ThemeProvider>;Note that createTheme accepts any number of arguments.If you are already using the translations of the core components, you can add bgBG as a new argument.The same import works for DataGridPro as it's an extension of DataGrid.import { createTheme, ThemeProvider } from '@material-ui/core/styles';import { DataGrid, bgBG } from '@mui/x-data-grid';import { bgBG as coreBgBG } from '@material-ui/core/locale';const theme = createTheme( { palette: { primary: { main: '#1976d2' }, }, }, bgBG, coreBgBG,);ThemeProvider theme={theme}> DataGrid />ThemeProvider>;If you want to pass language translations directly to the grid without using createTheme and ThemeProvider, you can directly load the language translations from the @mui/x-data-grid or @mui/x-data-grid-pro package.import { DataGrid, nlNL } from '@mui/x-data-grid';DataGrid localeText={nlNL.props.MuiDataGrid.localeText} />;Supported localesLocaleBCP 47 language tagImport nameArabic (Sudan)ar-SDarSDBulgarianbg-BGbgBGCzechcs-CZcsCZDutchnl-NLnlNLEnglish (United States)en-USenUSFrenchfr-FRfrFRGermande-DEdeDEGreekel-GRelGRItalianit-ITitITJapaneseja-JPjaJPPolishpl-PLplPLPortuguese (Brazil)pt-BRptBRRussianru-RUruRUSlovaksk-SKskSKSpanish (Spain)es-ESesESTurkishtr-TRtrTRUkraineuk-UAukUAYou can find the source in the GitHub repository.To create your own translation or to customize the English text, copy this file to your project, make any changes needed and import the locale from there.Please do consider contributing new translations back to Material-UI by opening a pull request. However, Material-UI aims to support the 100 most popular locales. We might not accept contributions for locales that are not frequently used, for instance, gl-ES that has "only" 2.5 million native speakers.See the Docs for more details.APIDataGridDataGridPro
2025-04-22The variant prop. const StatRoot = styled('div', { name: 'MuiStat', slot: 'root',- })(({ theme }) => ({+ })(({ theme, ownerState }) => ({ display: 'flex', flexDirection: 'column', gap: theme.spacing(0.5), padding: theme.spacing(3, 4), backgroundColor: theme.palette.background.paper, borderRadius: theme.shape.borderRadius, boxShadow: theme.shadows[2], letterSpacing: '-0.025em', fontWeight: 600,+ ...ownerState.variant === 'outlined' && {+ border: `2px solid ${theme.palette.divider}`,+ }, }));4. Support theme default propsTo customize your component's default props for different projects, you need to use the useThemeProps API.+ import { useThemeProps } from '@mui/material/styles';- const Stat = React.forwardRef(function Stat(props, ref) {+ const Stat = React.forwardRef(function Stat(inProps, ref) {+ const props = useThemeProps({ props: inProps, name: 'MuiStat' }); const { value, unit, ...other } = props; return ( {value} {unit} ); });Then you can customize the default props of your component like this:import { createTheme } from '@mui/material/styles';const theme = createTheme({ components: { MuiStat: { defaultProps: { variant: 'outlined', }, }, },});TypeScriptIf you use TypeScript, you must create interfaces for the component props and ownerState:interface StatProps { value: number | string; unit: string; variant?: 'outlined';}interface StatOwnerState extends StatProps { // …key value pairs for the internal state that you want to style the slot // but don't want to expose to the users}Then you can use them in the component and slots.const StatRoot = styled('div', { name: 'MuiStat', slot: 'root',}){ ownerState: StatOwnerState }>(({ theme, ownerState }) => ({ display: 'flex', flexDirection: 'column', gap: theme.spacing(0.5), padding: theme.spacing(3, 4), backgroundColor: theme.palette.background.paper, borderRadius: theme.shape.borderRadius, boxShadow: theme.shadows[2], letterSpacing: '-0.025em', fontWeight: 600, // typed-safe access to the `variant` prop ...(ownerState.variant === 'outlined' && { border: `2px solid ${theme.palette.divider}`, boxShadow: 'none', }),}));// …do the same for other slotsconst Stat = React.forwardRefHTMLDivElement, StatProps>(function Stat(inProps, ref) { const props = useThemeProps({ props: inProps, name: 'MuiStat' }); const { value, unit, variant, ...other } = props; const ownerState = { ...props, variant }; return ( StatRoot ref={ref} ownerState={ownerState} {...other}> StatValue ownerState={ownerState}>{value}StatValue> StatUnit ownerState={ownerState}>{unit}StatUnit> StatRoot> );});Finally, add the Stat component to the theme types.import { ComponentsOverrides, ComponentsVariants, Theme as MuiTheme,} from '@mui/material/styles';import { StatProps } from 'path/to/Stat';type Theme = OmitMuiTheme, 'components'>;declare module '@mui/material/styles' { interface ComponentNameToClassKey { MuiStat: 'root' | 'value' | 'unit'; } interface ComponentsPropsList { MuiStat: PartialStatProps>; } interface Components { MuiStat?: { defaultProps?: ComponentsPropsList['MuiStat']; styleOverrides?: ComponentsOverridesTheme>['MuiStat']; variants?: ComponentsVariants['MuiStat']; }; }}TemplateThis template is the final product of the step-by-step guide above, demonstrating how to build a custom component that can be styled with the theme as if it was a built-in component.
2025-04-14A fast and extendable library of react chart components for data visualization.FeedbackBundle sizeOverviewThe @mui/x-charts is an MIT library for rendering charts relying on D3.js for data manipulation and SVG for rendering.And, like other MUI X components, charts are production-ready components that integrate smoothly into your app.With a high level of customization, MUI X Charts provides three levels of customization layers: single components with great defaults, extensive configuration props, and subcomponents for flexible composition.Additionally, you can also use all the MUI System tools, such as the theme override or the sx prop.Press Enter to start editingUsing the documentationThe MUI X Charts documentation has a slightly different structure than other MUI X components.Instead of having a long page for each, the pages are divided in two:General description of the built-in features the component provides.A set of examples demonstrating the component with customizations.All MUI X Charts componentsSupported featuresThe features that are shared across multiple Charts components, such as axes and legends, are also documented on separate pages.
2025-04-23