Reactive window size and media query states for VueJS. Supports your favourite UI framework grid breakpoints out of the box, and can be configured with any custom breakpoints.
✔ Reactive and debounced window innerWidth and innerHeight ↔ 🕐
✔ 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 🚀 📟 (Nuxt module included)
Requirements
As the library uses Vue.Observable API internally, Vue 2.6+ is required.
String
Returns the currently active breakpoint. If you use custom breakpoint names, you must also provide the breakpointsOrder property (see below).
breakpointsOrder
Array
Contains the order of the custom breakpoints provided in the configuration. This is required for the breakpoint property to work with custom breakpoint names.
Example:
If you extend one of the default frameworks, breakpointsOrder is provided automatically.
<breakpoint key>
Boolean
Every breakpoint key specified in the configuration will be available as a boolean value indicating if the corresponding media query matches.
To view default breakpoint keys and values for each framework, click here.
<callback name>
Any
Every callback specified in the configuration will have a corresponding property indicating the result of the callback. Callbacks will be called on every debounced resize event.
Nuxt module
The library can be used directly as a Nuxt module, just add it to the module section in nuxt.config.js:
Reactive screen size and media query states for Vue. Integrates with most UI frameworks out of the box.
The npm package vue-screen receives a total of 8,875 weekly downloads. As such, vue-screen popularity was classified as popular.
We found that vue-screen demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 0 open source maintainers collaborating on the project.
Package last updated on 13 Nov 2019
Did you know?
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.