Socket
Book a DemoInstallSign in
Socket

minimum-window-size

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minimum-window-size

Minimum Window Size library is a React library that prevents users with small window size from using your React app and visually hints users to adjust window size.

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

Minimum Window Size library is a React library that prevents users with small window size from using your React app and visually hints users to adjust window size.

Demo

demo gif It hides the content when window size is small and shows the content when the window resizes to required size.

Install

npm i minimum-window-size

or

yarn add minimum-window-size

Usage

import React from 'react'

import Index from "minimum-window-size";

const App = () => {
    return <Index width={1200} height={768}>
        <YourComponent/>
    </Index>
}

export default App

Simply import the library and wrap your components. Index should be the out-most component. width and height attributes describes the breakpoints at where your component should display. You can omit one or both of the attribute and by default they are set to 0.

Run example locally

npm i
cd example
yarn install
yarn start

An example React project is provided in the example/ folder if you want to see the exapmle usage.

Keywords

minimum

FAQs

Package last updated on 04 Dec 2020

Did you know?

Socket

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