Skip to content

Commit

Permalink
add documentation and update version to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bofeiw committed Dec 4, 2020
1 parent c92fd55 commit d73521d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
Initial version of minimum-window-size library
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](example/minimum-window-size-demo.gif)
It hides the content when window size is small and shows the content when the window resizes to required size.

# Install

```shell script
npm i minimum-window-size
```
or
```shell script
yarn add minimum-window-size
```

# Usage

```javascript
import React from 'react'

import MinimumWindowSize from "minimum-window-size";

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

export default App
```
Simply import the library and wrap your components. MinimumWindowSize 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
```shell script
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.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minimum-window-size",
"version": "0.1.0",
"version": "1.0.0",
"description": "",
"main": "./lib/MinimumWindowSize.js",
"license": "MIT",
Expand Down

0 comments on commit d73521d

Please sign in to comment.