react-layout-switch
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

React Layout Switch

Simple path-based desktop/mobile switching

Usage

import LayoutSwitch from 'react-layout-switch'

function App() {
  const layout = window.innerWidth > window.innerHeight ? 'desktop' : 'mobile'
  return (
    <LayoutSwitch layout={layout} mobilePrefix='m'>
      ...
    </LayoutSwitch>
  )
}
  • Renders /m/... if mobile
  • Otherwise renders /...

Readme

Keywords

none

Package Sidebar

Install

npm i react-layout-switch

Weekly Downloads

3

Version

1.0.0

License

ISC

Unpacked Size

4.06 kB

Total Files

7

Last publish

Collaborators

  • moveread