An icon for clearing text appears on the focused <input>.
npm install input-clear-iconAn icon for clearing text appears on the focused <input>.
* No dependencies
* Lightweight (CSS + JS = about 2kB gzipped)
* Minimal side effects
* Simplest usage
* Stylable
* Various icon stroke width
You can easily try it out with just adding the stylesheet and the script.
1. Apply the stylesheet.
``html`
`
2. Load the script.
html`
3. Place input elements as usual.
1. Install this package.
`bash`
$ npm install input-clear-icon
`
2. Bundle the stylesheet and the script.
javascript``
import 'input-clear-icon/input-clear-icon.regular.css';
import 'input-clear-icon/input-clear-icon.js';
3. Place input elements as usual.
* "input-clear-icon" is the tag name of the clear icon that can be used as a CSS selector.
* "data-input-clear-icon-class" attribute of the input element is applied as the class name.
* "data-input-clear-icon-style" attribute of the input element is applied as the inline style.
See the demo for example.
WTFPL