StellarUI

<stellar-rating>

Properties

Preview

Markup

Copy
<stellar-rating
  tone="primary"
  label="Satisfaction"
  description="How was your experience?"
  value="3.5"
  step="0.5"
  name="satisfaction"
>
</stellar-rating>

API

Complete props, events, slots, and implementation notes for the shipped rating.

Props

PropTypeDefaultNotes
toneneutral | primary | secondary | tertiary | errorneutralControls the active symbol color and committed-value indicator.
sizexs | sm | md | lg | xlmdScales the symbol row.
labelstring''Fallback text for the label slot above the control.
descriptionstring''Fallback text for the description slot below the control.
iconstringmdi:heartWhen present, renders a built-in stellar-icon for each symbol.
namestring''Mirrors into an internal hidden input so the current value can submit with a form.
valuenumber0The current rating value.
maxnumber5Sets the number of rating symbols.
stepnumber1Controls rating granularity. Use 0.5 for half ratings.
disabledbooleanfalseDisables pointer and keyboard interaction.
readonlybooleanfalseShows the current rating without allowing edits.

Events

EventSourceNotes
inputhostFires while the user changes the rating with pointer or keyboard interaction.
changehostFires when the user commits a new rating value.

Slots

SlotNotes
labelOptional content above the control. Overrides the label prop when present.
descriptionOptional helper content below the control. Overrides the description prop when present.
iconOptional symbol template. The component clones it for each active and inactive symbol.

Notes

  • The public tag is `stellar-rating`, shipped as one standalone control instead of a authored radio wrapper.
  • `step` controls fractional ratings, so `step="0.5"` gives half ratings without a second public half API.
  • `tone` follows the rest of the StellarUI field family and drives both the active symbols and the committed-value indicator while previewing.
  • `icon` follows the same prop-first pattern as the rest of StellarUI, while the named `icon` slot remains available for custom symbol markup.
  • A mirrored hidden input keeps `name` and `value` usable in normal form submission without turning the component into a form-associated custom element yet.