LLWidgetVoteOption

LLWidgetVoteOption is a container component that renders a vote based widget option details using LLWidgetOption as its presentational component. It derives all the option details and interaction handler needed by LLWidgetOption component.
This widget is used by:

Hooks used by LLWidgetVoteOption

LLWidgetVoteOption Props

📘

Customisation

Refer customisation core concepts to understand different level of component customisation.

widgetId

TypeDefault
String (Required)No Default

optionIndex

TypeDefault
Number (Required)No Default

Index of the widget option

selectedOptionIndex

TypeDefault
Number (Required)-1 when no option is selected

Index of the selected widget option

correctable

TypeDefault
Booleanfalse

Specify whether a widget option is correctable i.e show a green border for a correct option or red border for an incorrect option. Used by Prediction follow up widget.

onOptionChange

TypeDefault
(optionIndex: number) => void;No Default

Function that gets invoked with option index whenever vote option is selected.

OptionComponent

TypeDefault
Component of type LLWidgetOptionLLWidgetOption

Presentational component for option component.

OptionComponentStyles

TypeDefault
StyleSheet of type LLWidgetOptionStylesNo Default, if present styles props would be applied on top of internal LLWidgetOptionStyles

OptionComponentStyles prop that could be used to modify styles of default rendered LLWidgetOption component.