Input Rating
The Input Rating component provides an interactive star rating interface with customizable icons, keyboard navigation, and form integration.
Basic usage
The Input Rating component implements ControlValueAccessor for form integration and provides a visual rating system.
Component anatomy
Rating Scale
Configure the rating scale using:
maxValue
Input: Set number of stars (1-10, default 5)value
Input: Current rating (0 to maxValue)- Form control binding for value management
- Automatic validation of input ranges
Icons
Customize rating visuals with:
iconEmptySvgName
Input: Unselected state iconiconFilledSvgName
Input: Selected state icon- Automatic state switching
- Size and spacing consistency
- RTL support
Selection Label
Control label display using:
showActiveSelectionLabel
Input: Toggle visibilityactiveSelectionLabelSingular
: Single item textactiveSelectionLabelPlural
: Multiple items text- Automatic pluralization
- Screen reader support
Keyboard Navigation
Comprehensive keyboard support:
- Left/Right arrows for RTL-aware navigation
- Up/Down arrows for value adjustment
- Circular navigation at boundaries
- Focus management
- ARIA role integration
Form Integration
Complete form control features:
- Value accessor implementation
- Touch tracking
- Change detection
- Disabled state support
- Focus management
Negative Theme
Enable dark theme using the negative
Input, affecting:
- Icon colors
- Label colors
- Focus indicators
- Button states
Accessibility
ARIA Implementation
Complete ARIA integration:
- radiogroup role for container
- radio role for rating buttons
- Selected state tracking
- Label relationships
- Value announcements
Keyboard Navigation
Full keyboard support:
- Arrow key navigation
- RTL adaptation
- Circular navigation
- Focus management
- Button activation
Screen Reader Support
Enhanced value communication:
- Current rating announcements
- Label integration
- State changes
- Range context
- Button purposes
Best Practices for Developers
Scale Configuration DEMO HERE
Label Implementation DEMO HERE
Form Integration DEMO HERE