Skip to content

[docs] Using Joy UI and Material UI together #45134

@atillaaliyev

Description

@atillaaliyev

Related page

https://mui.com/joy-ui/integrations/material-ui/#set-up-the-providers , https://mui.com/material-ui/integrations/theme-scoping/

Kind of issue

Unclear explanations

Issue description

I'm using Joy UI with Material UI. However, I dont understand which document is right.

This correct ;

import { ThemeProvider, THEME_ID, createTheme } from '@mui/material/styles';
import { AnotherThemeProvider } from 'another-ui-library';

const materialTheme = createTheme(/* your theme */);

function App() {
  return (
    <AnotherThemeProvider>
      <ThemeProvider theme={{ [THEME_ID]: materialTheme }}>
        {/* components from another library and Material UI */}
      </ThemeProvider>
    </AnotherThemeProvider>
  );
}

or this ;

import {
  extendTheme as materialExtendTheme,
  CssVarsProvider as MaterialCssVarsProvider,
  THEME_ID as MATERIAL_THEME_ID,
} from '@mui/material/styles';
import { CssVarsProvider as JoyCssVarsProvider } from '@mui/joy/styles';
import CssBaseline from '@mui/material/CssBaseline';

const materialTheme = materialExtendTheme();

export default function App() {
  return (
    <MaterialCssVarsProvider theme={{ [MATERIAL_THEME_ID]: materialTheme }}>
      <JoyCssVarsProvider>
        <CssBaseline enableColorScheme />
        ...Material UI and Joy UI components
      </JoyCssVarsProvider>
    </MaterialCssVarsProvider>
  );
}

Context

No response

Search keywords: using-joy-with-mui

Metadata

Metadata

Assignees

Labels

linked in docsThe issue is linked in the docs, so completely skew the upvotes.package: joy-uiSpecific to Joy UI.support: docs-feedbackFeedback from documentation page.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions