Any other virtual element properties, including attributes and event handlers.
Optional
allowWhether to allow fractional display (e.g., 3.5 stars)
Optional
aria-ARIA label for the component
Optional
aria-ARIA labelledby reference
Optional
ariaARIA label for the component (camelCase alternative)
Optional
classThe class name(s) for this virtual element, as a space-separated list.
Optional
classClass name for the container
Optional
clearableWhether the rating can be cleared/reset to 0
Optional
defaultInitial value for uncontrolled mode
Optional
densityDensity variant
Optional
disabledWhether the rating is disabled
Optional
getFunction to get label text for accessibility
Optional
iconCustom icon configuration
Optional
idHTML ID for the component
Optional
keyA key to optionally associate with this element.
Optional
maxMaximum rating value (default: 5)
Optional
nameName for form submission
Optional
onchangeCallback when rating changes
Optional
onmouseoverCallback when rating is hovered (preview mode)
Optional
readonlyWhether the rating is read-only
Optional
showWhether to show tooltips on hover
Optional
sizeSize variant
Optional
stepStep size for rating increments (default: 1, can be 0.5 for half-steps)
Optional
styleAdditional CSS styles
Optional
tooltipCustom tooltip labels for each rating value
Optional
valueCurrent rating value
Optional
onbeforeremoveThe onbeforeremove hook is called before a DOM element is detached from the document. If a Promise is returned, Mithril only detaches the DOM element after the promise completes.
Optional
onbeforeupdateThe onbeforeupdate hook is called before a vnode is diffed in a update.
Optional
oncreateThe oncreate hook is called after a DOM element is created and attached to the document.
Optional
oninitThe oninit hook is called before a vnode is touched by the virtual DOM engine.
Optional
onremoveThe onremove hook is called before a DOM element is removed from the document.
Optional
onupdateThe onupdate hook is called after a DOM element is updated, while attached to the document.
Rating component attributes