2.4.0 • Published 1 month ago

vue-screen v2.4.0

Weekly downloads
4,053
License
MIT
Repository
github
Last release
1 month ago

Build Status Build Status npm version npm downloads codecov

Warning: Version 2.x only supports Vue 3. v1 docs are available here

VueScreen

Reactive screen size and media query states for Vue. Supports your favourite UI framework out of the box, and can be configured with any custom breakpoints.

Docs

https://reegodev.github.io/vue-screen

Features

  • Reactive and debounced screen size
  • Reactive media query states and device orientation
  • Detect touch screen capability
  • Breakpoints for most common ui frameworks provided out of the box: Tailwind, Bootstrap, Bulma, Foundation, Materialize, Semantic UI
  • SSR compatible

Installation

npm i vue-screen
yarn add vue-screen

Quick start

Use with composition API

import { useScreen, useGrid } from 'vue-screen'

export default {
    setup() {
        const screen = useScreen()
        const grid = useGrid('bulma')

        return {
            screen,
            grid
        }
    }
}

For advanced configurations, check out the docs website.

Use as a plugin

import { createApp } from 'vue'
import VueScreen from 'vue-screen'

// In App.vue
createApp()
  .use(VueScreen, 'bootstrap')
  .mount('#app')

// In MyComponent.vue
<template>
    <ul>
        <li>Current breakpoint is: {{ $grid.breakpoint }}</li>
        <li>Window width is: {{ $screen.width }}</li>
        <li>Window height is: {{ $screen.height }}</li>
    </ul>
</template>

Upgrading from v1

v2 introduces a few breaking changes both in the configuration and in the API. Read more about them in the docs section.

License

MIT

2.4.0

1 month ago

2.3.0

10 months ago

2.3.2

9 months ago

2.3.1

10 months ago

2.2.0

1 year ago

2.1.0-beta.1

2 years ago

1.5.6

3 years ago

1.5.5

3 years ago

2.1.0-alpha.5

3 years ago

2.0.4-alpha.4

3 years ago

2.0.3-alpha.3

3 years ago

1.5.4

3 years ago

2.0.1-alpha.1

3 years ago

2.0.1-alpha.2

3 years ago

2.0.2-alpha.3

3 years ago

2.0.0-alpha.0

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.4.0-rc1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.1.0-rc1

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago