iron-label
A version of the <label> element that works with Custom Elements as well as native elements.
<iron-label>
<iron-label>
provides a version of the <label>
element that works with Custom Elements as well as native elements. All text in the iron-label
will be applied to the target element as a screen-reader accessible description.
See: Documentation, Demo.
Usage
Installation
npm install --save @polymer/iron-label
In an html file
<html>
<head>
<script type="module">
import '@polymer/iron-label/iron-label.js';
import '@polymer/paper-button/paper-button.js';
</script>
</head>
<body>
<iron-label>Label for a button
<paper-button>button</paper-button>
</iron-label>
<iron-label for="foo">Label for the foo button</iron-label>
<paper-button id="foo">Another button</paper-button>
</body>
</html>
In a Polymer 3 element
import {PolymerElement, html} from '@polymer/polymer';
import '@polymer/iron-label/iron-label.js';
import '@polymer/paper-button/paper-button.js';
class SampleElement extends PolymerElement {
static get template() {
return html`
<iron-label>Label for a button
<paper-button>button</paper-button>
</iron-label>
<iron-label for="foo">Label for the foo button</iron-label>
<paper-button id="foo">Another button</paper-button>
`;
}
}
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
git clone https://github.com/PolymerElements/iron-label
cd iron-label
npm install
npm install -g polymer-cli
Running the demo locally
polymer serve --npm
open http://127.0.0.1:<port>/demo/
Running the tests
polymer test --npm
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Dependencies
- @polymer/polymer#^3.0.0
- Released
- 2018-09-14
- Maturity
- IMPORTED
- License
- BSD 3-clause "New" or "Revised" License
Compatibility
- Framework
- Polymer 3.0+
- Polymer 2.0+ in 2.1.0
- Polymer 1.0+ in 1.0.2
- Browser
- Browser Independent
iron-label - Vaadin Add-on Directory
A version of theLicense
View on NPM
iron-label version 1.0.0
### Dependencies
* polymer#Polymer/polymer#^1.0.0
iron-label version 1.0.1
### Dependencies
* polymer#Polymer/polymer#^1.0.0
iron-label version 1.0.2
### Dependencies
* polymer#Polymer/polymer#^1.0.0
iron-label version 0.0.1
### Dependencies
* @polymer/polymer#^1.2.5-npm-test.2
iron-label version 0.0.3
### Dependencies
* @polymer/polymer#^1.2.5-npm-test.2
iron-label version 2.0.0
### Dependencies
* polymer#Polymer/polymer#1.9 - 2
iron-label version 3.0.0-pre.1
### Dependencies
* @polymer/polymer#^3.0.0-pre.1
iron-label version 3.0.0-pre.2
### Dependencies
* @polymer/polymer#^3.0.0-pre.1
iron-label version 3.0.0-pre.3
### Dependencies
* @polymer/polymer#^3.0.0-pre.3
iron-label version 3.0.0-pre.4
### Dependencies
* @polymer/polymer#^3.0.0-pre.4
iron-label version 3.0.0-pre.6
### Dependencies
* @polymer/polymer#^3.0.0-pre.6
iron-label version 3.0.0-pre.7
### Dependencies
* @polymer/polymer#^3.0.0-pre.7
iron-label version 3.0.0-pre.8
### Dependencies
* @polymer/polymer#^3.0.0-pre.7
iron-label version 2.1.0
### Dependencies
* polymer#Polymer/polymer#1.9 - 2
iron-label version 3.0.0-pre.10
### Dependencies
* @polymer/polymer#^3.0.0-pre.10
iron-label version 3.0.0-pre.11
### Dependencies
* @polymer/polymer#^3.0.0-pre.10
iron-label version 3.0.0-pre.12
### Dependencies
* @polymer/polymer#3.0.0-pre.12
iron-label version 3.0.0-pre.13
### Dependencies
* @polymer/polymer#^3.0.0-pre.13
iron-label version 3.0.0-pre.14
### Dependencies
* @polymer/polymer#^3.0.0-pre.13
iron-label version 3.0.0-pre.15
### Dependencies
* @polymer/polymer#^3.0.0-pre.13
iron-label version 3.0.0-pre.16
### Dependencies
* @polymer/polymer#^3.0.0-pre.13
iron-label version 3.0.0-pre.17
### Dependencies
* @polymer/polymer#^3.0.0-pre.13
iron-label version 3.0.0-pre.18
### Dependencies
* @polymer/polymer#^3.0.0
iron-label version 3.0.0-pre.19
### Dependencies
* @polymer/polymer#^3.0.0
iron-label version 3.0.0-pre.20
### Dependencies
* @polymer/polymer#^3.0.0
iron-label version 3.0.0-pre.21
### Dependencies
* @polymer/polymer#^3.0.0
iron-label version 3.0.0-pre.22
### Dependencies
* @polymer/polymer#^3.0.0
iron-label version 3.0.0-pre.23
### Dependencies
* @polymer/polymer#^3.0.0
iron-label version 3.0.0-pre.24
### Dependencies
* @polymer/polymer#^3.0.0
iron-label version 3.0.0-pre.25
### Dependencies
* @polymer/polymer#^3.0.0
iron-label version 3.0.0-pre.26
### Dependencies
* @polymer/polymer#^3.0.0
iron-label version 3.0.0
### Dependencies
* @polymer/polymer#^3.0.0
iron-label version 3.0.1
### Dependencies
* @polymer/polymer#^3.0.0