Skip to content

Commit a2be6ab

Browse files
committed
update readme
1 parent e2fe035 commit a2be6ab

File tree

1 file changed

+55
-32
lines changed

1 file changed

+55
-32
lines changed

README.md

Lines changed: 55 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,67 @@
1+
[![Published on NPM](https://img.shields.io/npm/v/@polymer/paper-input.svg)](https://www.npmjs.com/package/@polymer/paper-input)
12
[![Build status](https://travis-ci.org/PolymerElements/paper-input.svg?branch=master)](https://travis-ci.org/PolymerElements/paper-input)
2-
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://beta.webcomponents.org/element/PolymerElements/paper-input)
3+
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/paper-input)
34

45
## <paper-input>
6+
`<paper-input>` is a single-line text field with Material Design styling.
57

6-
Material design: [Text fields](https://www.google.com/design/spec/components/text-fields.html)
8+
See: [Documentation](https://www.webcomponents.org/element/@polymer/paper-input),
9+
[Demo](https://www.webcomponents.org/element/@polymer/paper-input/demo/demo/index.html).
710

8-
`<paper-input>` is a single-line text field with Material Design styling.
11+
## Usage
912

10-
<!---
13+
### Installation
1114
```
12-
<custom-element-demo>
13-
<template>
14-
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
15-
<link rel="import" href="paper-input.html">
16-
<link rel="import" href="../iron-icons/iron-icons.html">
17-
<style>
18-
paper-input {
19-
max-width: 400px;
20-
margin: auto;
21-
}
22-
iron-icon, div[suffix] {
23-
color: hsl(0, 0%, 50%);
24-
margin-right: 12px;
25-
}
26-
</style>
27-
<next-code-block></next-code-block>
28-
</template>
29-
</custom-element-demo>
15+
npm install --save @polymer/paper-input
3016
```
31-
-->
17+
18+
### In an html file
3219
```html
33-
<paper-input always-float-label label="Floating label"></paper-input>
34-
<paper-input label="username">
35-
<iron-icon icon="mail" slot="prefix"></iron-icon>
36-
<div slot="suffix">@email.com</div>
37-
</paper-input>
20+
<html>
21+
<head>
22+
<script type="module">
23+
import '@polymer/paper-input/paper-input.js';
24+
</script>
25+
</head>
26+
<body>
27+
<paper-input always-float-label label="Floating label"></paper-input>
28+
</body>
29+
</html>
30+
```
31+
### In a Polymer 3 element
32+
```js
33+
import {PolymerElement, html} from '@polymer/polymer';
34+
import '@polymer/paper-input/paper-input.js';
35+
36+
class SampleElement extends PolymerElement {
37+
static get template() {
38+
return html`
39+
<paper-input always-float-label label="Floating label"></paper-input>
40+
`;
41+
}
42+
}
43+
customElements.define('sample-element', SampleElement);
3844
```
3945

40-
### Changes in 2.0
41-
- Distribution is now done with slots, so things have changed because of that (before: <label>foo</label>, now <label slot="label">foo</label>; same for input, prefix and suffix)
42-
- Since type extensions are not available, any use of `<input is="iron-input">` has been replaced by `<iron-input><input></iron-input>`. See [iron-input](https://github.com/PolymerElements/iron-input) for more details about that change
43-
- `prevent-invalid-input` and `allowed-pattern` had to be always used together; deleted `prevent-invalid-input`, so that only `allowed-pattern` is needed
46+
## Contributing
47+
If you want to send a PR to this element, here are
48+
the instructions for running the tests and demo locally:
4449

50+
### Installation
51+
```sh
52+
git clone https://github.com/PolymerElements/paper-input
53+
cd paper-input
54+
npm install
55+
npm install -g polymer-cli
56+
```
57+
58+
### Running the demo locally
59+
```sh
60+
polymer serve --npm
61+
open http://127.0.0.1:<port>/demo/
62+
```
63+
64+
### Running the tests
65+
```sh
66+
polymer test --npm
67+
```

0 commit comments

Comments
 (0)