Config
Custom Adaptive Logic
AdaptiveThemeProvider.adaptiveModeInfo can be set if you want to use a different user agent
or completely control the adaptive logic yourself. The theme uses AdaptiveModeContext to pass
this info to the child components which can be used separately if needed.
Different User Agent
Theme
Context
Custom Logic
Theme
Context
SSR
See the example project using Next.js
Enforce Adaptive Component Use
ESLint can be configured to warn when using MUI components that have Adaptive counterparts
by adding the following rule to your ESLint config file.
This will for example warn if the <Button> component is used instead of <AdaptiveButton>.
Specific components can be excluded by passing a list of MUI names into the excludeComponents option.
Minimizing Bundle Size
To avoid barrel imports similar ESLint & VS Code settings can be configured as shown here.