Skip to content

[material-next] Add documentation on how to provide a custom theme for the Material You components #37601

Open
@Onibenjo

Description

@Onibenjo

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example:
https://codesandbox.io/s/pedantic-architecture-yjt5x5?file=/src/App.js
Steps:

  1. Wrap app with ThemeProvider
  2. use material-next button
  3. app breaks

Current behavior 😯

Cannot read properties of undefined (reading 'color')
But it works fine without the ThemeProvider.
I want to change the theme of the buttons and get the above error

Expected behavior 🤔

It should work fine as the @mui/material button and should also work fine as it does without the ThemeProvider

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
 System:
    OS: macOS 13.3.1
  Binaries:
    Node: 20.2.0 - ~/.nvm/versions/node/v20.2.0/bin/node
    Yarn: Not Found
    npm: 9.6.6 - ~/.nvm/versions/node/v20.2.0/bin/npm
  Browsers:
    Chrome: 114.0.5735.106
    Edge: Not Found
    Firefox: Not Found
    Safari: 16.4
  npmPackages:
    @emotion/react: ^11.11.1 => 11.11.1
    @emotion/styled: ^11.11.0 => 11.11.0
    @mui/base:  5.0.0-beta.4
    @mui/core-downloads-tracker:  5.13.4
    @mui/material: ^5.13.5 => 5.13.5
    @mui/material-next: ^6.0.0-alpha.89 => 6.0.0-alpha.89
    @mui/private-theming:  5.13.1
    @mui/styled-engine:  5.13.2
    @mui/system:  5.13.5
    @mui/types:  7.2.4
    @mui/utils:  5.13.1
    @types/react: ^17.0.0 => 17.0.59
    react: ^17.0.2 => 17.0.2
    react-dom: ^17.0.2 => 17.0.2
    typescript: ^4.9.5 => 4.9.5

Metadata

Metadata

Assignees

Labels

component: buttonThis is the name of the generic UI component, not the React module!customization: themeCentered around the theming featuresdocsImprovements or additions to the documentationready to takeHelp wanted. Guidance available. There is a high chance the change will be accepted

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions