react-mobile-only
A react component that will only display its children on mobile resolutions.
Installation
The react-mobile-only
package is available from NPM via yarn
or the npm
CLI.
npm i --save react-mobile-only
Usage
The component can be used by wrapping child components to restrict their display to mobile devices.
const AppBanner = <MobileOnly> Download our app from the <a href=appplay_store_url>Play Store</a> or the <a href=appapp_store_url>App Store</a> </MobileOnly>
By default, the component will display for screen resolutions below 768px. By passing a mobileSize
prop to the component, or by setting theme.mobileSize
in the styled-components theme.
License
MIT