Skip to content

Commit

Permalink
Update "Set up providers" section of integration with Material UI
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuseap committed Feb 2, 2025
1 parent 706d0f3 commit d95d17b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/data/joy/integrations/material-ui/material-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ Additionally, keep these in mind when using them together:

## Set up the providers

Render Joy UI's `CssVarsProvider` inside Material UI's provider and use `THEME_ID` to separate the themes from each other.
Render Joy UI's `CssVarsProvider` inside Material UI's `ThemeProvider` and use `THEME_ID` to separate the themes from each other.

Check failure on line 28 in docs/data/joy/integrations/material-ui/material-ui.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [MUI.MuiBrandName] Use a non-breaking space (option+space on Mac, Alt+0160 on Windows or AltGr+Space on Linux, instead of space) for brand name ('Material UI' instead of 'Material UI') Raw Output: {"message": "[MUI.MuiBrandName] Use a non-breaking space (option+space on Mac, Alt+0160 on Windows or AltGr+Space on Linux, instead of space) for brand name ('Material UI' instead of 'Material UI')", "location": {"path": "docs/data/joy/integrations/material-ui/material-ui.md", "range": {"start": {"line": 28, "column": 42}}}, "severity": "ERROR"}

```js
import {
extendTheme as materialExtendTheme,
CssVarsProvider as MaterialCssVarsProvider,
createTheme,
ThemeProvider,
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();
const materialTheme = createTheme();

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

0 comments on commit d95d17b

Please sign in to comment.