Adaptive Mode
useAdaptiveMode
The useAdaptiveMode hook can be used to get the current adaptive mode based on the current context & device.
In this example the button will be round only on iOS devices.
AdaptiveThemeProvider
AdaptiveThemeProvider.theme accepts a function which is passed the current adaptive mode based
on the current context & device. In this example all buttons will default to round only on iOS devices.
Mode Specific Components
Most components with behavior that varies based on device type have component counterparts for each device type,
for example AdaptiveSlider has SliderAndroid, SliderDesktop, & SliderIOS.
These components can be used directly to have the same behavior across all devices, like in the following example
where the SliderIOS component is used.
Note:
- The font will not vary between components since it's applied via
AdaptiveThemeProvider. - To style the components via a theme use the MUI component names instead of the Adaptive ones
(eg.
MuiButtonnotAdaptiveButton)