Skip to content

Rating - Web Component

The Rating component can be used imported from:

Playground

Parameters

...

Events

This component has events. Check the documentation about how to use the events.

NamePayloadDescription
changenumberReturns the new value of the "value" attribute
restartedvoidEmitted on value reset
blurvoidEmitted on blur

Slots

This component has slots. Check the documentation about how to use the slots.

NameTagsDescription

Parameters use

model

The value parameter is used to set the value of the rating.

Flags

readonly

The readonly parameter is used to set the rating in a read-only state.

disabled

The disabled parameter is used to block the interaction with the component.

show-score

The show-score parameter is used to display the score of the rating.

Methods

reset()

We can all the reset() method of the WebComponent in order to reset the value. This will clean the internal states and emit the nullable value with the change event, plus a restarted event:

In this example, the button triggers the method:

Value:  undefined

Browser support

Detected engine:  

  • Chromium

  • Webkit

  • Gecko

HTML Examples

CodeSandbox example