1.0.2 • Published 5 years ago

typed-responsive-react v1.0.2

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

typed-responsive-react

This is typed version of responsive-react npm package.

Demo

Install

npm i -D typed-responsive-react

How to use

Following can be imported from this package

import {
    Responsive,
    getWindowDimension,
    getDeviceTypeInfo,
    isMobileDevice,
    isTabletDevice,
    isLaptopDevice,
    isBiggerThanLaptop,
    IDeviceInfo,
    IWindowDimension
} from 'typed-responsive-react';

Responsive

<>
    <Responsive displayIn={["laptop"]}>
        Content to be displayed in LAPTOP
    </Responsive>
    <Responsive displayIn={["mobile", "tablet"]}>
        Content to be displayed in LAPTOP
    </Responsive>
</>

getDeviceTypeInfo() function returns of type IDeviceInfo contains following information:

isMobileDevice, isTabletDevice, isLaptopDevice and isBiggerThanLaptop

These function returns boolean value for each deviceType.