Material design for Vue.js
Find a file
Marcos Moura c7c0d0e231 Merge remote-tracking branch 'origin/develop' into components/mdSelect
* origin/develop:
  Finish md-menu spec
  Add keyboard shortcuts to menu
  Add close event on tab
  Close content on esc
  Drop transitionend dependency
  Keep menu content inside viewport
  Recalculate position on resize
  Add menu code in card example
  Add menu in a button text
  Add menu to card example
  Refactor huge method
  Make menu open in a correct position
  Add initial styles and detach and attach menu on click
  Force size of demo example
  Add page title
  Add menu tag
  Add empty md-menu files
2016-11-03 01:42:55 -02:00
build Add initial firefox support and finish first documentation release 2016-10-17 04:33:00 -02:00
dist Generate v0.2.0 documentation 2016-10-24 03:02:01 -02:00
docs Merge pull request #30 from marcosmoura/components/mdMenu 2016-11-03 01:42:36 -02:00
src Merge remote-tracking branch 'origin/develop' into components/mdSelect 2016-11-03 01:42:55 -02:00
.babelrc Change all webpack tasks 2016-10-13 03:27:58 -03:00
.editorconfig Order 2016-07-13 02:39:15 -03:00
.eslintrc Change all webpack tasks 2016-10-13 03:27:58 -03:00
.gitignore Remove old rules 2016-10-17 00:19:12 -02:00
LICENSE Add LICENSE 2016-10-14 11:42:59 -03:00
package.json Finish md-menu spec 2016-10-25 05:09:44 -02:00
README.md Finish md-menu spec 2016-10-25 05:09:44 -02:00
yarn.lock Finish md-menu spec 2016-10-25 05:09:44 -02:00

Vue.js Material

Material Design for Vue.js

Vue Material is lightweight framework built exactly according to the Material Design specs. It aims to deliver a collection of reusable components and a series of UI Elements to build applications with support to modern Web Browsers through Vue 2.0. Build powerful and well-designed web apps that can can fit on every screen. You can generate and use themes dynamically, use components on demand, take advantage of UI Elements and Components with an ease-to-use API.

Demo and Documentation

Demo

Installation

Import Roboto and Google Icons from Google CDN:

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons">

Install Vue Material through npm or yarn

npm install --save vue-material
yarn add vue-material

* Others package managers like JSPM and Bower are not supported yet.

Import or require Vue and Vue Material in your code:

import Vue from 'vue'
import VueMaterial from 'vue-material'
import 'vue-material/dist/vue-material.css'

// OR

var Vue = require('vue')
var VueMaterial = require('vue-material')
require('vue-material/dist/vue-material.css')

Alternativelly you can download and reference the script and the stylesheet in your HTML:

<link rel="stylesheet" href="path/to/vue-material.css">
<script src="path/to/vue-material.js"></script>

Usage

Enable Vue Material in your application using Vue.use(). You can always enable individual components:

Vue.use(VueMaterial)

// OR

Vue.use(VueMaterial.mdCore) //Required to boot vue material
Vue.use(VueMaterial.mdButton)
Vue.use(VueMaterial.mdIcon)
Vue.use(VueMaterial.mdSidenav)
Vue.use(VueMaterial.mdToolbar)

To get Vue Material working properly, you'll need to configure and apply a default theme.

Vue.material.theme.register('default', {
  primary: 'cyan',
  accent: 'pink'
})

Or you can register multiple themes at once.

Vue.material.theme.registerAll({
  default: {
    primary: 'cyan',
    accent: 'pink'
  },
  phone: {
    primary: 'indigo',
    accent: 'pink'
  }
})

Apply your theme using v-md-theme directive:

<div v-md-theme="'default'"></div>
<div v-md-theme="'phone'"></div>

Changelog

Changelog

Build Setup

### Install dependencies
npm install
yarn

### Start dev server with hot reload
npm run dev

### Build everything
npm run build

### Build docs only
npm run build:docs

### Build lib only
npm run build:lib

Credits and Thanks

  • This library aims to delivery components using almost the same API of Angular Material
  • Thanks a lot to elviskang for donating the npm package name!
  • Thanks to Evan You for allowing me to use Vue.js Logo.

Internal Dependencies

You don't need to include any other library to work with vue-material. The focus of this project is to have a standalone build with no external dependence, but aiming to deliver the best experience without break the compatibility with the Vue.js core.

License

MIT