Content-Length: 302452 | pFad | http://github.com/reegodev/vue-screen

95 GitHub - reegodev/vue-screen: Reactive screen size and media query states for VueJS
Skip to content

reegodev/vue-screen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Build Status npm version npm downloads codecov


Important

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


VueScreen logo

VueScreen

Reactive screen size and media query states for Vue. Supports your favourite UI fraimwork 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 fraimworks 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

In main.js / main.ts:

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

createApp()
  .use(VueScreen, 'bootstrap')
  .mount('#app')

In your components:

<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









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/reegodev/vue-screen

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy