1. vue-breakpoints

vue-breakpoints

vue-breakpoints

Build Status
codecov
npm
vue2
license

Vue.js utility component to show and hide components based on breakpoints

📺 Demo

🔧 Install

yarn add vue-breakpoints

👈 Usage

 
<template>
  <nav>
    <hide-at breakpoint="medium">
      <mobile-nav />
    </hide-at>
    <show-at breakpoint="mediumAndAbove">
      <desktop-nav>
    </show-at>
  </nav>
</template>

<script>
  import {showAt, hideAt} from 'vue-breakpoints'
  export default {
    components: { hideAt, showAt }
  }
</script>

Breakpoints

You can pass following values as a breakpoint:

  • small
  • mediumAndBelow
  • medium
  • mediumAndAbove
  • largeAndBelow
  • large

Default Breakpoints

Default breakpoints are

 small: 744,
medium: 1128,
large: Infinity

but they can be overwritten if you pass an object to the breakpoints prop.

 <show-at :breakpoints="{small: 620, medium: 1280, large: 1600}" breakpoint="medium">

Props

prop default type description
breakpoints undefined Object Important that if you pass the object you only use small, medium and large as the childs.
breakpoint '' String Breakpoint where it should show or hide small, mediumAndBelow, medium, mediumAndAbove, largeAndBelow, large

:scroll: Changelog

Details changes for each release are documented in the CHANGELOG.md.

:exclamation: Issues

Please make sure to read the Issue Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.

:muscle: Contribution

Please make sure to read the Contributing Guide and Code of Conduct before making a pull request.

MIT

Dependencies

autoprefixer: ^7.1.2avoriaz: ^3.5.0babel-core: ^6.22.1babel-eslint: ^7.1.1babel-helper-vue-jsx-merge-props: ^2.0.2babel-loader: ^7.1.1babel-plugin-istanbul: ^4.1.1babel-plugin-syntax-jsx: ^6.18.0babel-plugin-transform-runtime: ^6.22.0babel-plugin-transform-vue-jsx: ^3.5.0babel-preset-env: ^1.3.2babel-preset-es2015: ^6.24.1babel-preset-stage-2: ^6.22.0babel-register: ^6.22.0chai: ^3.5.0chalk: ^2.0.1connect-history-api-fallback: ^1.3.0copy-webpack-plugin: ^4.0.1cross-env: ^5.0.1css-loader: ^0.28.0cssnano: ^3.10.0eslint: ^4.5.0eslint-config-standard: ^10.2.1eslint-friendly-formatter: ^3.0.0eslint-loader: ^1.7.1eslint-plugin-html: ^3.0.0eslint-plugin-import: ^2.7.0eslint-plugin-node: ^5.1.1eslint-plugin-promise: ^3.4.0eslint-plugin-standard: ^3.0.1eventsource-polyfill: ^0.9.6express: ^4.14.1extract-text-webpack-plugin: ^2.0.0file-loader: ^0.11.1friendly-errors-webpack-plugin: ^1.1.3html-webpack-plugin: ^2.28.0http-proxy-middleware: ^0.17.3inject-loader: ^3.0.0karma: ^1.4.1karma-coverage: ^1.1.1karma-mocha: ^1.3.0karma-phantomjs-launcher: ^1.0.2karma-phantomjs-shim: ^1.4.0karma-sinon-chai: ^1.3.1karma-sourcemap-loader: ^0.3.7karma-spec-reporter: 0.0.31karma-webpack: ^2.0.2mocha: ^3.2.0opn: ^5.1.0optimize-css-assets-webpack-plugin: ^2.0.0ora: ^1.2.0phantomjs-prebuilt: ^2.1.14rimraf: ^2.6.0semver: ^5.3.0shelljs: ^0.7.6sinon: ^2.1.0sinon-chai: ^2.8.0url-loader: ^0.5.8vue: ^2.4.2vue-loader: ^13.0.4vue-style-loader: ^3.0.1vue-template-compiler: ^2.4.2webpack: ^3.5.5webpack-bundle-analyzer: ^2.2.1webpack-dev-middleware: ^1.10.0webpack-hot-middleware: ^2.18.0webpack-merge: ^4.1.0