1.0.0 • Published 10 months ago
@http.cat/http-cat-element v1.0.0
http-cat
This is a web component for embedding images from HTTP Cats.
Here's a live demo.
Install
npm install @http.cat/http-cat-elementImport
If installed via NPM:
import "@http.cat/http-cat-element";Or just import the component file in your HTML:
<script type="module" src="http-cat.js"></script>Usage
To use it just add the following markup to your HTML:
<http-cat status="404"></http-cat>Attributes
status: change it so that the image matches the corresponding HTTP status code
This component supports all img element attributes.
Why didn't you extend the img native element instead?
Safari does not currently support custom elements that extend native elements. Therefore, an autonomous custom element is used to ensure maximum browser compatibility.
LICENSE
MIT License
1.0.0
10 months ago