Reactive Screen Size And Media Query States for VueJS

vue-media-query-screen-size

VueScreen@next interactive screen size and media query states for Vue. It supports your favorite UI framework out of the box and can be configured with any custom breakpoints.

jquery media query, media query not working, javascript media query, media query max width, media query min width, media query css for all devices, media query screen size

Features

  • Reactive screen size and bounce
  • Interactive media query cases and device routing
  • Touch screen capability detection
  • Breakpoints for most popular UI frameworks offered out of the box: Tailwind, Bootstrap, Bulma, Foundation, Materialize, Semantic UI
  • SSR compatible with Nuxt module included. Nuxt module development awaiting Nuxt 3 release

How to make use of it:

Install and download:

# Yarn
$ yarn add vue-screen

# NPM
$ npm install vue-screen --save

1. Install and import the module.

import Vue from 'vue';
import VueScreen from 'vue-screen';

2. Register the component and select the framework you want to use.

// Tailwind (default)
Vue.use(VueScreen); 
// Bootstrap
Vue.use(VueScreen, 'bootstrap'); 
// Bulma
Vue.use(VueScreen, 'bulma'); 
// Foundation
Vue.use(VueScreen, 'foundation'); 
// Materialize
Vue.use(VueScreen, 'materialize'); 
// Semantic UI
Vue.use(VueScreen, 'semantic-ui');

3. Or using custom breakpoints.

Vue.use(VueScreen, {
  sm: 480, 
  md: '45em',
  lg: '1280px'
});

4. Enter the component in your app template.

<template>
  <div>
    <p>Page width is {{ $screen.width }} px</p>
    <p>Page height is {{ $screen.height }} px</p>
    <p>Current breakpoint is {{ $screen.breakpoint }} px</p>
  </div>
</template>

Detect Window Size And Media Query, [email protected] Plugin/Github


See Demo And Download

Official Website(reegodev): Click Here

This superior jQuery/javascript plugin is developed by reegodev. For extra Advanced Usage, please go to the official website.

Share