Rating

Star-based rating component. Supports read-only display, interactive editing, half-star increments, and keyboard navigation.

Read-Only

Product
Service

Interactive

Rate this

Sizes

Small
Medium
Large

Custom Colour

Danger
Success
Click a star to rate...
PHP

PHP PHP Methods (Fluent)

Method / PropertyParametersDescription
$m->rating($id)stringCreate a rating component.
->value($v)floatInitial rating value.
->max($m)intNumber of stars (default: 5).
->readonly($ro)boolMake display-only (default: false).
->halfStars($half)boolEnable half-star rendering (default: false).
->label($text)stringLabel text beside the stars.
->size($s)stringSize: sm, md, lg.
->sm()Small size shorthand.
->lg()Large size shorthand.
->color($c)stringColour: primary, warning, danger, success, purple.
->onChange($callback)stringJS function name or expression called with (value, element).

JS JS Methods

Method / PropertyParametersDescription
m.rating(id, overrides)string, ?objectGet or create rating instance.
getValue()Returns the current rating value.
setValue(value)numberSet the rating value.
destroy()Clean up event listeners.

EVENT Events

Event NameDetailDescription
m-rating-change{value}Fired when the rating value changes (interactive mode).