@substrate-system/arrow-prev
v0.0.2
Published
Back arrow button as a web component
Downloads
6
Readme
arrow prev
An icon button for going backwards.
install
npm i -S @substrate-system/arrow-prev
API
This exposes ESM and common JS via package.json exports
field.
ESM
import '@substrate-system/arrow-prev'
Common JS
require('@substrate-system/arrow-prev')
CSS
@substrate-system/css-util
Use @substrate-system/css-util/arrow
, or import CSS from this module.
import '@substrate-system/css-util/arrow'
Import this module's CSS
import '@substrate-system/arrow-prev/css'
Or minified:
import '@substrate-system/arrow-prev/css/min'
use
This calls the global function customElements.define
. Just import, then use
the tag in your HTML.
JS
import '@substrate-system/arrow-prev'
HTML
<div>
<arrow-prev></arrow-prev>
</div>
pre-built
This package exposes minified JS and CSS files too. Copy them to a location that is accessible to your web server, then link to them in HTML.
copy
cp ./node_modules/@substrate-system/arrow-prev/dist/index.min.js ./public/arrow-prev.min.js
cp ./node_modules/@substrate-system/arrow-prev/dist/style.min.css ./public/arrow-prev.css
HTML
<head>
<link rel="stylesheet" href="./arrow-prev.css">
</head>
<body>
<!-- ... -->
<script type="module" src="./arrow-prev.min.js"></script>
</body>