Formulaires v1.0.0

Notation

Champ de notation par étoiles (ou icône personnalisée). Prend en charge la précision demi-étoile, le mode affichage en lecture seule et les formes d'icônes personnalisées. Inclut un aperçu au survol et la navigation au clavier. Fonctionne en autonome ou dans les formulaires Rails via un champ caché.

Aperçu et code

Options

Nom Type Par défaut Description
value Float 0 Current rating value
max Integer 5 Maximum number of stars
precision Float 1 Rating precision: 1 (full stars) or 0.5 (half stars)
icon Symbol :star Icon shape: :star or :heart
size Symbol :md Icon size: :sm, :md, or :lg
readonly Boolean false Read-only display mode — no hover or click interaction
label String nil Optional label text rendered above the stars
show_value Boolean false Show numeric rating value next to the stars
clearable Boolean true Allow clearing the rating by clicking the current value again
name String nil Form field name — renders a hidden input for form submission
disabled Boolean false Disable all interaction (opacity + pointer-events-none)

Journal des modifications v1.0.0

- 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

Obtenir l'accès complet

Débloquez le code source de ce composant et de tous les autres. Paiement unique pour un accès à vie.

Obtenir l'accès maintenant