Summary
A table column for displaying numeric ratings as a series of stars or custom icons. It supports fractional fills (e.g., 4.5 stars), custom icons, and color-coded states. Pair this with RatingField for a complete rating system.| Class | Bjanczak\FilamentFlexFields\Filament\Tables\Columns\RatingColumn |
| State type | float|int|null |
| Model cast | 'rating' => 'float' |
| Playground | rating-column slug in Flex Fields playground |
| Default max | 5 |
| Default icon | heroicon-s-star |
Basic usage
Standard 5-star rating
Custom icons and colors
State & formatting
Stored value
The column expects a numeric value (integer or float). Values exceeding thestars() count are capped at the maximum.
Fractional Fills
RatingColumn automatically calculates fractional fills for non-integer values. A rating of 3.7 will show three full stars and one star filled to 70%.
Displaying the numeric value
By default, the numeric value is shown next to the icons. You can hide it if needed:Configuration API
All methods acceptClosure unless noted.
| Method | Type | Default | Description |
|---|---|---|---|
stars(int|Closure $count) | Setup | 5 | Maximum number of icons to show |
ratingColor(string|Closure $color) | Setup | 'warning' | Icon fill color |
ratingIcon(string|Closure $icon) | Setup | star | Filament icon string |
showValue(bool|Closure $cond) | Setup | true | Show numeric value text |
ratingSize(string|Closure $size) | Setup | 'md' | sm, md, lg |
Real-world examples
Product Reviews Table
Playground
/admin/flex-fields-playground/rating-column
See Playground for setup.
Related components
| Component | When to use instead |
|---|---|
| RatingField | Form input for collecting ratings |
| NpsField | Survey-style NPS or Likert scales |
| ProgressBar | Linear progress instead of icon rating |
CSS classes (reference)
| Class | Role |
|---|---|
fff-rating-column | Root wrapper |
fff-rating-column__icons | Container for all icons |
fff-rating-column__icon-wrapper | Individual icon container |
fff-rating-column__icon-bg | Background (empty) icon |
fff-rating-column__icon-fill | Foreground (filled) icon |
fff-rating-column__value | Numeric value text |