shaf-rate
v1.0.0
Published
Accessible star rating element. Upgrades <input type="number" />
Downloads
9
Maintainers
Readme
It's easy peasy
Keyboard accessible. Check out the demo. Works in IE11, Edge, Chrome, Firefox, and Safari.
<!-- Custom Elements v1 polyfill (2.7KB gzipped) -->
<script src="https://unpkg.com/@webcomponents/[email protected]"></script>
<!-- Our custom element's source -->
<script src="https://unpkg.com/[email protected]"></script>
Usage
<shaf-toggle>
<input type="number" min="1" max="10" step="0.5" value="5" />
</shaf-toggle>
Benefits
Because this wraps an existing <input type="number" />
:
- It is form-friendly.
- It doesn't mess with your event handlers.
- Your checkbox still works if JavaScript is turned off or fails to load.