Socket
Socket
Sign inDemoInstall

react-device-mode

Package Overview
Dependencies
35
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-device-mode

device viewer for a-blog cms


Version published
Weekly downloads
57
increased by3.64%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-device-mode

Install

$ npm install react-device-mode --save

Usage

<ReactDeviceMode
  src={src}
  i18n={{ fitWindow: '画面サイズにあわせる' }}
  onClose={() => {}}
  devices={[
    {
      name: 'PC',
      ua: 'none',
      width: window.innerWidth - 100,
      height: window.innerHeight - 300,
      resizable: true
    },
    {
      name: 'iPhone 6/7/8',
      ua: 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1',
      width: 375,
      height: 667,
      resizable: false
    },
  ]}
/>);

Options

NameDefaultDescription
src-Set the URL of the page you want to display.
defaultDevice-First, set the device to be displayed.
devices-Set the device information that can be displayed.
hasHstoryDevicetrueSaves the most recently used device method in local storage.
historyDeviceKey'reactDeviceModeHistory'Set the local storage key.
hasCloseBtntrueSets the display of the close button.
isLoadingfalseSet loading display.

FAQs

Last updated on 19 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc