Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
alioguzhan committed Oct 18, 2023
1 parent 496afd6 commit fc8d4a9
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ yarn add use-screen
## Usage

```js
import useScreen from 'use-screen'
import useScreen from 'use-screen';

const { isMobile, isWideScreen, screenWidth } = useScreen()
const { isMobile, isWideScreen, screenWidth } = useScreen();

// use screen width and other variables as you like
```

See the website to see how it works: [https://alioguzhan.github.io/use-screen/](https://alioguzhan.github.io/use-screen/)

There is also a working live example as a sandbox:

[![Edit use-screen-hook](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/use-screen-hook-80toq?fontsize=14&hidenavigation=1&theme=dark)
Expand All @@ -37,13 +39,13 @@ There is also a working live example as a sandbox:

```ts
interface State {
isMobile: boolean, // < 768px
isTablet: boolean, // < 1280px
isComputer: boolean, // > 1280px
isLargeScreen: boolean, // < 1920px
isWideScreen: boolean, // > 1920px
screenWidth: number // current screen width (innerWidth)
screenHeight: number // current screen height (innerHeight)
isMobile: boolean; // < 768px
isTablet: boolean; // < 1280px
isComputer: boolean; // > 1280px
isLargeScreen: boolean; // < 1920px
isWideScreen: boolean; // > 1920px
screenWidth: number; // current screen width (innerWidth)
screenHeight: number; // current screen height (innerHeight)
}
```

Expand Down

0 comments on commit fc8d4a9

Please sign in to comment.