-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
material-uimaterial-ui related theme issuematerial-ui related theme issueneeds reproducible exampleMissing a link to a reproduction in the playground, CodeSandbox, JSFiddle, etc.Missing a link to a reproduction in the playground, CodeSandbox, JSFiddle, etc.question
Description
Prerequisites
- I have read the documentation
What theme are you using?
material-ui
What is your question?
How is it possible to enable material-ui 5s darkmode? I googled and also checked the documentation but could not find anything specifically.
Themeprovider does not seem to work when set around the Form component.
https://mui.com/material-ui/customization/dark-mode/#dark-mode-only
import { ThemeProvider, createTheme } from '@mui/material/styles'
import CssBaseline from '@mui/material/CssBaseline'
import { withTheme } from '@rjsf/core'
import { Theme } from '@rjsf/mui'
import validator from '@rjsf/validator-ajv8'
...
const textRootPath = 'rootPath'
const Form = withTheme(Theme)
const darkTheme = createTheme({
palette: {
mode: 'dark'
}
})
....
<ThemeProvider theme={darkTheme}>
<CssBaseline />
<Form
key={new Date().getTime()}
//className="readableBackground"
children={true} // hide submit button
schema={treeState.customDataHolder?.jsonSchema?.referenceData}
uiSchema={{}}
formData={{}}
validator={validator}
onChange={onFormChange}
onSubmit={onSubmit}
onError={customLog('errors')}
/>
</ThemeProvider>
Metadata
Metadata
Assignees
Labels
material-uimaterial-ui related theme issuematerial-ui related theme issueneeds reproducible exampleMissing a link to a reproduction in the playground, CodeSandbox, JSFiddle, etc.Missing a link to a reproduction in the playground, CodeSandbox, JSFiddle, etc.question