Class IgcRatingComponent

Rating provides insight regarding others' opinions and experiences, and can allow the user to submit a rating of their own

igc-rating

igcChange - Emitted when the value of the control changes.

igcHover - Emitted when hover is enabled and the user mouses over a symbol of the rating.

base - The main wrapper which holds all of the rating elements.

label - The label part.

value-label - The value label part.

symbols - A wrapper for all rating symbols.

symbol - The part of the encapsulated default symbol.

full - The part of the encapsulated full symbols.

empty - The part of the encapsulated empty symbols.

--symbol-size - The size of the symbols.

--symbol-full-color - The color of the filled symbol.

--symbol-empty-color - The color of the empty symbol.

--symbol-full-filter - The filter(s) used for the filled symbol.

--symbol-empty-filter - The filter(s) used for the empty symbol.

Hierarchy

Hierarchy

  • FormAssociatedElementInterface<this> & EventEmitterInterface<IgcRatingEventMap, this> & LitElement<this>
    • IgcRatingComponent

Properties

allowReset: boolean = false

Whether to reset the rating when the user selects the same value.

allow-reset

disabled: boolean

The disabled state of the component

[disabled=false]

hoverPreview: boolean = false

Sets hover preview behavior for the component

hover-preview

invalid: boolean

Control the validity of the control.

label: string

The label of the control.

max: number = 5

The maximum value for the rating.

If there are projected symbols, the maximum value will be resolved based on the number of symbols.

name: string

The name attribute of the control.

readOnly: boolean = false

Makes the control a readonly field.

readonly

single: boolean = false

Toggles single selection visual mode.

step: number = 1

The minimum value change allowed.

Valid values are in the interval between 0 and 1 inclusive.

value: number = 0

The current value of the component

valueFormat: string

A format string which sets aria-valuetext. Instances of '{0}' will be replaced with the current value of the control and instances of '{1}' with the maximum value for the control.

Important for screen-readers and useful for localization.

value-format

tagName: "igc-rating" = 'igc-rating'

Returns the HTML-uppercased qualified name.

MDN Reference

Accessors

  • get form(): null | HTMLFormElement
  • Returns the HTMLFormElement associated with this element.

    Returns null | HTMLFormElement

  • get validationMessage(): string
  • A string containing the validation message of this element.

    Returns string

  • get validity(): ValidityState
  • Returns a ValidityState object which represents the different validity states the element can be in, with respect to constraint validation.

    Returns ValidityState

  • get willValidate(): boolean
  • A boolean value which returns true if the element is a submittable element that is a candidate for constraint validation.

    Returns boolean

Methods

  • Checks for validity of the control and emits the invalid event if it invalid.

    Returns boolean

  • Checks for validity of the control and shows the browser message if it invalid.

    Returns boolean

  • Sets a custom validation message for the control. As long as message is not empty, the control is considered invalid.

    Parameters

    • message: string

    Returns void

  • Decrements the value of the control by n steps multiplied by the step factor.

    Parameters

    • n: number = 1

    Returns void

  • Increments the value of the control by n steps multiplied by the step factor.

    Parameters

    • n: number = 1

    Returns void