Giter VIP home page Giter VIP logo

material-webcomponents's Introduction

Material Web Components

Material Design implemented in Web Components (Custom Elements v1) https://dannymoerkerke.github.io/material-webcomponents/

Getting started

To install Material Web Components run:

npm install @dannymoerkerke/material-webcomponents

Then simply import the component you need in your script, for example:

import './node_modules/@dannymoerkerke/material-webcomponents/src/material-button.js';

Or include it with a script tag as an ES6 module:

<script src="node_modules/@dannymoerkerke/material-webcomponents/src/material-button.js" type="module"></script>

Add the HTML tag:

<material-button label="Confirm" raised></material-button>

...and you're in business!

Documentation

Refer to https://dannymoerkerke.github.io/material-webcomponents/ for documentation of each component.

Demo

To run the demo, run npm install once and then npm start and view the demo on http://localhost:8080/material-webcomponents

Testing

Run npm test and view the results on http://localhost:8080/ or run npm run test:headless to run the tests on the command line.

This repo also contains the configuration file wallaby.js to run the tests from your IDE using Wallaby.js

Browser support

  • Chrome 53+
  • Firefox 63+
  • Safari 10+
  • iOS Safari 10+
  • Chrome Android 71+
  • Firefox Android 64+
  • Edge 16+ (with polyfill)

Polyfilling Edge 16+

Refer to /lib/polyfill-loader.js to see how the webcomponentsjs polyfill and the Webpack bundle are loaded. The Webpack bundle only parses the CSS inside Shadow DOM. Note that the webpack loader is only suitable for browsers that do not support Shadow DOM.

material-webcomponents's People

Contributors

dannymoerkerke avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

material-webcomponents's Issues

Link button to dialogue

Hi,

I'm using your components for a project but I've run into a problem: it seems that I can't associate a button to open a dialogue. Right now this is my code:

<material-button id="open-modal" label="Sign In"></material-button>
<material-dialog id="modal">
    <h1 slot="header">Sign In</h1>
    <p slot="body"> Sign In here </p>
    <div slot="footer">
      <button id="action">close</button>
    </div>
</material-dialog>

The button itself shows up well, I just can't open dialogue with it. Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.