iron-image
Image element with sizing and preloading options
<iron-image>
iron-image
is an element for displaying an image that provides useful sizing
and preloading options not found on the standard <img>
tag.
See: Documentation, Demo.
Usage
Installation
npm install --save @polymer/iron-image
In an HTML file
<html>
<head>
<script type="module">
import '@polymer/iron-image/iron-image.js';
</script>
<style>
iron-image {
width: 400px;
height: 400px;
background-color: lightgray;
}
</style>
</head>
<body>
<iron-image sizing="cover" preload src="http://lorempixel.com/600/400"></iron-image>
</body>
</html>
In a Polymer 3 element
import {PolymerElement} from '@polymer/polymer/polymer-element.js';
import {html} from '@polymer/polymer/lib/utils/html-tag.js';
import '@polymer/iron-image/iron-image.js';
class ExampleElement extends PolymerElement {
static get template() {
return html`
<iron-image sizing="contain" fade src="http://lorempixel.com/600/400"></iron-image>
`;
}
}
customElements.define('example-element', ExampleElement);
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-image
cd iron-image
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
- 2019-04-26
- Maturity
- IMPORTED
- License
- BSD 3-clause "New" or "Revised" License
Compatibility
- Framework
- Polymer 3.0+
- Polymer 2.0+ in 2.2.1
- Polymer 1.0+ in 3.0.1
- Browser
- Browser Independent
iron-image - Vaadin Add-on Directory
Image element with sizing and preloading optionsIssue tracker
License
View on NPM
View on GitHub
Documentation
Online Demo
iron-image version 0.8.0
### Dependencies
Polymer/polymer#v0.8.0-rc.4
* layout#polymerelements/paper-styles#^0.8.0
iron-image version 0.8.1
### Dependencies
Polymer/polymer#v0.8.0-rc.6
* layout#polymerelements/paper-styles#^0.8.0
iron-image version 0.8.2
### Dependencies
Polymer/polymer#v0.8.0-rc.7
* polymerelements/paper-styles#^0.8.0
iron-image version 0.8.3
### Dependencies
Polymer/polymer#v0.8.0-rc.7
* polymerelements/iron-flex-layout#^0.8.0
iron-image version 0.9.0
### Dependencies
Polymer/polymer#v0.9.0-rc.1
* polymerelements/iron-flex-layout#^0.9.0
iron-image version 0.9.1
### Dependencies
polymerelements/iron-flex-layout#^0.9.0
* Polymer/polymer#^0.9.0
iron-image version 1.0.0
### Dependencies
* iron-flex-layout#polymerelements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.0.0
iron-image version 1.0.1
### Dependencies
* iron-flex-layout#polymerelements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.0.0
iron-image version 1.0.2
### Dependencies
* iron-flex-layout#polymerelements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.0.0
iron-image version 1.0.3
### Dependencies
* iron-flex-layout#polymerelements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.0.0
iron-image version 1.0.4
### Dependencies
* iron-flex-layout#polymerelements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.0.0
iron-image version 1.1.0
### Dependencies
* iron-flex-layout#polymerelements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.0.0
iron-image version 1.2.0
### Dependencies
* iron-flex-layout#PolymerElements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.1.0
iron-image version 1.2.1
### Dependencies
* iron-flex-layout#PolymerElements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.1.0
iron-image version 0.0.1
### Dependencies
* @polymer/iron-flex-layout#^0.0.1
* @polymer/polymer#^1.2.5-npm-test.2
iron-image version 0.0.3
### Dependencies
* @polymer/iron-flex-layout#^0.0.3
* @polymer/polymer#^1.2.5-npm-test.2
iron-image version 1.2.2
### Dependencies
* iron-flex-layout#PolymerElements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.1.0
iron-image version 1.2.3
### Dependencies
* iron-flex-layout#PolymerElements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.1.0
iron-image version 1.2.4
### Dependencies
* iron-flex-layout#PolymerElements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.1.0
iron-image version 1.2.5
### Dependencies
* iron-flex-layout#PolymerElements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.1.0
iron-image version 1.2.6
### Dependencies
* iron-flex-layout#PolymerElements/iron-flex-layout#^1.0.0
* polymer#Polymer/polymer#^1.1.0
iron-image version 2.0.0
### Dependencies
* polymer#Polymer/polymer#1.9 - 2
iron-image version 2.1.0
### Dependencies
* polymer#Polymer/polymer#1.9 - 2
iron-image version 2.1.1
### Dependencies
* polymer#Polymer/polymer#1.9 - 2
iron-image version 2.1.2
### Dependencies
* polymer#Polymer/polymer#1.9 - 2
iron-image version 3.0.0-pre.1
### Dependencies
* @polymer/polymer#^3.0.0-pre.1
iron-image version 3.0.0-pre.2
### Dependencies
* @polymer/polymer#^3.0.0-pre.1
iron-image version 3.0.0-pre.3
### Dependencies
* @polymer/polymer#^3.0.0-pre.3
iron-image version 3.0.0-pre.4
### Dependencies
* @polymer/polymer#^3.0.0-pre.4
iron-image version 3.0.0-pre.6
### Dependencies
* @polymer/polymer#^3.0.0-pre.6
iron-image version 3.0.0-pre.7
### Dependencies
* @polymer/polymer#^3.0.0-pre.7
iron-image version 3.0.0-pre.8
### Dependencies
* @polymer/polymer#^3.0.0-pre.7
iron-image version 2.2.0
### Dependencies
* polymer#Polymer/polymer#1.9 - 2
iron-image version 3.0.0-pre.10
### Dependencies
* @polymer/polymer#^3.0.0-pre.10
iron-image version 3.0.0-pre.11
### Dependencies
* @polymer/polymer#^3.0.0-pre.10
iron-image version 3.0.0-pre.12
### Dependencies
* @polymer/polymer#3.0.0-pre.12
iron-image version 2.2.1
### Dependencies
* polymer#Polymer/polymer#1.9 - 2
iron-image version 3.0.0-pre.13
### Dependencies
* @polymer/polymer#^3.0.0-pre.13
iron-image version 3.0.0-pre.14
### Dependencies
* @polymer/polymer#^3.0.0-pre.13
iron-image version 3.0.0-pre.15
### Dependencies
* @polymer/polymer#^3.0.0-pre.13
iron-image version 3.0.0-pre.16
### Dependencies
* @polymer/polymer#^3.0.0-pre.13
iron-image version 3.0.0-pre.17
### Dependencies
* @polymer/polymer#^3.0.0-pre.13
iron-image version 3.0.0-pre.18
### Dependencies
* @polymer/polymer#^3.0.0
iron-image version 3.0.0-pre.19
### Dependencies
* @polymer/polymer#^3.0.0
iron-image version 3.0.0-pre.20
### Dependencies
* @polymer/polymer#^3.0.0
iron-image version 3.0.0-pre.21
### Dependencies
* @polymer/polymer#^3.0.0
iron-image version 3.0.0-pre.22
### Dependencies
* @polymer/polymer#^3.0.0
iron-image version 3.0.0-pre.23
### Dependencies
* @polymer/polymer#^3.0.0
iron-image version 3.0.0-pre.24
### Dependencies
* @polymer/polymer#^3.0.0
iron-image version 3.0.0-pre.25
### Dependencies
* @polymer/polymer#^3.0.0
iron-image version 3.0.0-pre.26
### Dependencies
* @polymer/polymer#^3.0.0
iron-image version 3.0.0
### Dependencies
* @polymer/polymer#^3.0.0
iron-image version 3.0.1
### Dependencies
* @polymer/polymer#^3.0.0
iron-image version 3.0.2
### Dependencies
* @polymer/polymer#^3.0.0