All Projects → reinerBa → Vue Responsive

reinerBa / Vue Responsive

Licence: mit
A plugin for responsive handling with vue.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Responsive

Flutterwebsite
The flutter.dev website recreated in Flutter. https://gallery.codelessly.com/flutterwebsites/flutterwebsite
Stars: ✭ 76 (-11.63%)
Mutual labels:  responsive, responsive-design
breaking-point
BREAKING-POINT lets you quickly define and subscribe to screen (i.e. window) breakpoints in your re-frame application
Stars: ✭ 36 (-58.14%)
Mutual labels:  responsive, responsive-design
pichichi
Simple one page responsive portfolio template
Stars: ✭ 54 (-37.21%)
Mutual labels:  responsive, responsive-design
Easygrid
EasyGrid - VanillaJS Responsive Grid
Stars: ✭ 77 (-10.47%)
Mutual labels:  responsive, responsive-design
React Native Responsive Grid
Bringing the Web's Responsive Design to React Native
Stars: ✭ 369 (+329.07%)
Mutual labels:  responsive, responsive-design
React Native Responsive Dimensions
Resposive fontSize, height and width for react-native components, that automatically adjusts itself based on screen-size of the device.
Stars: ✭ 243 (+182.56%)
Mutual labels:  responsive, responsive-design
ionic-login-component
Free sample of Premium Ionic Login Component
Stars: ✭ 17 (-80.23%)
Mutual labels:  responsive, responsive-design
Container Query
A PostCSS plugin and Javascript runtime combination, which allows you to write container queries in your CSS the same way you would write media queries.
Stars: ✭ 119 (+38.37%)
Mutual labels:  responsive, responsive-design
Layout
Flutter | Create responsive layouts for mobile, web and desktop
Stars: ✭ 312 (+262.79%)
Mutual labels:  responsive, responsive-design
FlexBoxFX
FlexBoxFX is a JavaFX implementation of CSS3 flexbox.
Stars: ✭ 65 (-24.42%)
Mutual labels:  responsive, responsive-design
Minwiz
Minimal starter kit for under 2 KB sites
Stars: ✭ 228 (+165.12%)
Mutual labels:  responsive, responsive-design
Textblock
Continuously responsive typesetting — Demo:
Stars: ✭ 536 (+523.26%)
Mutual labels:  responsive, responsive-design
Argon Design System
Argon - Design System for Bootstrap 4 by Creative Tim
Stars: ✭ 2,307 (+2582.56%)
Mutual labels:  responsive, responsive-design
just-responsive-images
WordPress Plugin to support better responsive images with <picture> tag, backgrounds, retina support etc.
Stars: ✭ 47 (-45.35%)
Mutual labels:  responsive, responsive-design
Paper Kit 2 Angular
Free Bootstrap 4 UI Kit for Angular 2+
Stars: ✭ 133 (+54.65%)
Mutual labels:  responsive, responsive-design
responsivebootstrap
This is the repository for my course, Bootstrap Layouts: Responsive Single-Page Design on LinkedIn Learning and Lynda.com.
Stars: ✭ 49 (-43.02%)
Mutual labels:  responsive, responsive-design
science-fiction-magazines-blog
Blog template (concept) is inspired by stylish science fiction magazines of the 80-90s.
Stars: ✭ 24 (-72.09%)
Mutual labels:  responsive, responsive-design
Argon Dashboard
Argon - Dashboard for Bootstrap 4 by Creative Tim
Stars: ✭ 429 (+398.84%)
Mutual labels:  responsive, responsive-design
Rocssti
RÖCSSTI : pour démarrer vos CSS avec la patate !
Stars: ✭ 46 (-46.51%)
Mutual labels:  responsive, responsive-design
React Bps
🔱 Create breakpoints to your component props
Stars: ✭ 64 (-25.58%)
Mutual labels:  responsive

Vue-Responsive

JavaScript Standard Style

vue2 npm GitHub stars license Github file size

NPM

Breaking Changes for verison 1.x:

  • Tag is now v-responsive the old v-responsiveness is no longer supported.
  • The file Vue_Responsive.common.js does no longer exist

Is a directive to use responsive breakpoints on html elements. Because sometimes it's nice to have a chance to let the view do resolution specific things.

  • No further Dependencies
  • 🔧 Chrome, Firefox, IE11+

📺 Check the Demo-link (IE11-Demo without webpack)

📖 Docs

🔧 Install

npm install vue-responsive

import responsive from 'vue-responsive'
Vue.use(responsive)

👈 Shortest usecase

Just put the breakpoint identifiers behind the directive with dots:

   <div v-responsive.lg.xl >Only visible on desktop !</div>

   <div v-responsive.md    >Visible on tablet ☺</div>

   <div v-responsive.sm.xs >Only visible on smartphone!</div>

👈 Small usage example

<template>
  <div>
    <h1 v-responsive="'hidden-xs'">Big Title</h1>
    <div v-responsive="['hidden-all','xs','sm']">
      Only visible in small and extra-small windows
    </div>

    <h1 v-responsive="middleSize">Big Jumbotron</h1>
  </div>
</template>

<script>
  import vueResponsive from 'vue-responsive'
  Vue.directive('responsive', vueResponsive)
  ...
  data:{
	middleSize: ['hidden-all','lg','xl']
  } 
</script>

Features

This directive adds responsive Feautures to single HTML-Elements without CSS or @Media.

The default Responsive breaks follow Bootstrap 4 Responsive Utils.

The Bootstrap 3 breakpoints are includes as well.

Do you miss a feature?

Take charge and file an issue or add your idea or vote for your favorite feature to be implemented:

Feature Requests

Usage

In the browser just include the script and use the directive on a Html-Element inside a Vue Element

<script src="Vue-Responsive.min.js"></script>

Advanced: If you do not want the directive to be globally available just add the attribute notGlobal with a not empty value in the script tag and define it the components with:

    <script src="Vue-Responsive.min.js" notGlobal="true" ></script>	
	...
	directives:{
		// the global variable is 'index.vueResponsive'
		responsive: index.vueResponsive
	}

For Bootstrap 4 breakpoints

At default every resolution is visible, the hidden-all tag changes this to everything hidden (display:none). These tags are valid hidden-all, xs, sm, md, lg, xl, hidden-xs,...,hidden-xl.

  <h1 v-responsive="'hidden-xs'">Big Title</h1>
  <div v-responsive="['hidden-all','md','lg']">Only visible in Middle and large Size View</div>
  <div v-responsive="['hidden-lg']">Only hidden at lg</div>

  <h1 v-responsive="middleSize">Jumbotron</h1>
  ...	//in the vue object
  data:{
    middleSize:['hidden-all','lg','xl']
  } 

For Bootstrap 3 breakpoints

Just add :bs3 after the directive to use bootstrap 3 breakpoints:

  <p v-responsive:bs3="['hidden-xs']">
    As you can see on the big picture below.<br /><img ... />
  </p>

In this defintion the xl breakpoint doesn't exist.

For self defined breakpoints

First you have to declar your own breakpoints in the component/root wich wraps the html-elements with the directive. Every definition must start with responsiveMarks$$ and a following name. So you can easily create breakpoints to differentiate between desktop and smartphones for instance, as you can see in the demo.html:

  <p v-responsive:twoMarks="'hidden-desktop'">
    Visible on smartphone<br />
    <img src="http://lorempixel.com/360/240/animals" />
  </p>

  ... //in the vue object
  data:{
    responsiveMarks$$twoMarks: {  //set a custom breakpoint with the name "twoMarks"
      smartphone: { 
        show: true, 
        min: -1, 
        max: 767 
      }, 
      desktop: { 
        show: true, 
        min: 768, 
        max: Infinity 
      } 
    }
  } 

You can declar as much own definitions as you wish. Every defintion should have min:-1 for its smalles breakpoint and max:Infinity for its biggest.

Planned

  • Mixin to trigger methods on breakpoint change
  • Add and remove classes instead of changing only the style

License

MIT MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].