DeviceTypeProvider
DeviceTypeProvider is an optional React Context provider to enable device-specific UI for Gestalt components that support it.
Props
Implementation
Gestalt components can have different interfaces depending on the user's device. We currently support "desktop" and "mobile".
Components default to a responsive "desktop" UI. DeviceTypeProvider is required to enable mobile-specific variants where available.
This provider should be implemented at the top level of your app. Any additional nested DeviceTypeProviders will override the top-level configuration.
While device detection can (for now) be performed using the user-agent string, this is not generally recommended. Thankfully, there are better solutions!
The example shows a component with different desktop and mobile UIs.