Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
57 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,67 @@ | ||
[![Published on NPM](https://img.shields.io/npm/v/@polymer/paper-spinner.svg)](https://www.npmjs.com/package/@polymer/paper-spinner) | ||
[![Build status](https://travis-ci.org/PolymerElements/paper-spinner.svg?branch=master)](https://travis-ci.org/PolymerElements/paper-spinner) | ||
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/PolymerElements/paper-spinner) | ||
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/paper-spinner) | ||
|
||
## <paper-spinner> | ||
Element providing a multiple color material design circular spinner. | ||
|
||
Material design: [Progress & activity](https://www.google.com/design/spec/components/progress-activity.html) | ||
See: [Documentation](https://www.webcomponents.org/element/@polymer/paper-spinner), | ||
[Demo](https://www.webcomponents.org/element/@polymer/paper-spinner/demo/demo/index.html). | ||
|
||
Element providing a multiple color material design circular spinner. | ||
## Usage | ||
|
||
<!--- | ||
### Installation | ||
``` | ||
<custom-element-demo> | ||
<template> | ||
<script src="../webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="paper-spinner.html"> | ||
<link rel="import" href="paper-spinner-lite.html"> | ||
<style is="custom-style"> | ||
paper-spinner, paper-spinner-lite { | ||
margin: 8px 8px 8px 0; | ||
} | ||
paper-spinner-lite.orange { | ||
--paper-spinner-color: var(--google-yellow-500); | ||
} | ||
paper-spinner-lite.green { | ||
--paper-spinner-color: var(--google-green-500); | ||
} | ||
paper-spinner-lite.thin { | ||
--paper-spinner-stroke-width: 1px; | ||
} | ||
paper-spinner-lite.thick { | ||
--paper-spinner-stroke-width: 6px; | ||
} | ||
#container { | ||
display: flex; | ||
} | ||
</style> | ||
<div id="container"> | ||
<next-code-block></next-code-block> | ||
</div> | ||
</template> | ||
</custom-element-demo> | ||
npm install --save @polymer/paper-spinner | ||
``` | ||
--> | ||
|
||
### In an html file | ||
```html | ||
<paper-spinner active>...</paper-spinner> | ||
<paper-spinner-lite active class="orange"></paper-spinner-lite> | ||
<paper-spinner-lite active class="green"></paper-spinner-lite> | ||
<paper-spinner-lite active class="thin"></paper-spinner-lite> | ||
<paper-spinner-lite active class="thick"></paper-spinner-lite> | ||
<html> | ||
<head> | ||
<script type="module"> | ||
import '@polymer/paper-spinner/paper-spinner.js'; | ||
</script> | ||
</head> | ||
<body> | ||
<paper-spinner active></paper-spinner> | ||
</body> | ||
</html> | ||
``` | ||
### In a Polymer 3 element | ||
```js | ||
import {PolymerElement, html} from '@polymer/polymer'; | ||
import '@polymer/paper-spinner/paper-spinner.js'; | ||
|
||
class SampleElement extends PolymerElement { | ||
static get template() { | ||
return html` | ||
<paper-spinner active></paper-spinner> | ||
`; | ||
} | ||
} | ||
customElements.define('sample-element', SampleElement); | ||
``` | ||
|
||
## Contributing | ||
If you want to send a PR to this element, here are | ||
the instructions for running the tests and demo locally: | ||
|
||
### Installation | ||
```sh | ||
git clone https://github.com/PolymerElements/paper-spinner | ||
cd paper-spinner | ||
npm install | ||
npm install -g polymer-cli | ||
``` | ||
|
||
### Running the demo locally | ||
```sh | ||
polymer serve --npm | ||
open http://127.0.0.1:<port>/demo/ | ||
``` | ||
|
||
### Running the tests | ||
```sh | ||
polymer test --npm | ||
``` |