Rating
Star (or custom icon) rating input. Supports half-star precision, read-only display mode, and custom icon shapes. Includes hover preview and keyboard navigation. Works standalone or inside Rails forms via a hidden input field.
Preview & Code
_rating.html.erb
███
██████ █████████ █████████
██████
███ ██████ ████████████████████ ██████ ████ ██████████ ████ ██████ █████ ███████ ██
███ ██████ ████████████████████ ██████ ██ █████ ███████ █████ ████ ███████████ ████ ██
███ ██████ ████████████████████ ██████ ██ █████████ ████ ██
███ ██████ ████████████████████ ██████ ██ █████ █████████████████ ██████████ ████ ██
██
rating_controller.js
██████ █ ██████████ █ ████ ████████████████████
██ ████████ ██ ████████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ ████████ ████████ ███████████████
██████ ██████ █ █
██████ █ █████ ███████ ████████ █ ██
████ █ █████ ███████ ████████ █ ██
██████████ █ █████ ███████ ████████ █ ██
█████████ █ █████ ████████ ████████ █████ ██
rating_component.html.erb
███
██████ █████████ ███████████████
██████
██████ ██████████████████████████ ████ ██████████ ████ ██████ █████ ████████
██████ ██████████████████████████ ██ █████ ███████ █████ ████ ███████████ █████
██████ ██████████████████████████ ██ █████████ █████
██████ ██████████████████████████ ██ █████ █████████████████ ██████████ █████
██
rating_component.rb
█ ██████████████████████ ████
█████ ███████████████ █ ███████████████████
█████ █ █
███ █ █████ ████ █████ ████ ██████████ █████ █████████ ██
███ █ █████ ████ █████ ████ ████████ █████ █████████ ██
███ █ █████ ████ █████ ████ ██████████ █████ ███████████ █
████████
███ ███████████
rating_controller.js
██████ █ ██████████ █ ████ ████████████████████
██ ████████ ██ ████████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ ████████ ████████ ███████████████
██████ ██████ █ █
██████ █ █████ ███████ ████████ █ ██
████ █ █████ ███████ ████████ █ ██
██████████ █ █████ ███████ ████████ █ ██
█████████ █ █████ ████████ ████████ █████ ██
Changelog
- Initial release with star and heart icon support
- Half-star precision mode with split click areas
- Hover preview with smooth color transitions
- Full keyboard navigation (arrow keys, Home, End)
- Read-only display mode for showing existing ratings
- Hidden input support for Rails form submission
- Three sizes: sm, md (default), lg
- Dark mode support throughout
Get Full Access
Unlock the source code for this component and all others. One-time payment for lifetime access.
Get Access Now