Skip to main content

Rating Input

Collects user feedback with emoji icons.

Examples

Basic Example

The following example demonstrate some of the available functionality for read_rating

from abstra.forms import read_rating

rating = read_rating("How do you rate this movie?")

Custom chars and number of points

The following example demonstrate some of the available functionality for read_rating

from abstra.forms import read_rating

rating = read_rating("How do you evaluate your Python skills?", char="🐍", max=3)

Parameters

NameDescriptionType
labelThe label to display to the userstr
initial_valueThe initial value to display to the user. Defaults to 0.int
maxMax value accepted by the input. Defaults to None.float
charWhich char should be displayed as icon?str
disabledwhether the input is disabled. Defaults to False.bool
requiredWhether the input is required or not eg. "this field is required". Defaults to True.Union[bool, str]
hintA tooltip displayed to the user. Defaults to None.str
full_widthWhether the input should use full screen width. Defaults to False.bool
button_textWhat text to display on the button when the widget is not part of a Page. Defaults to 'Next'.str

Return Values

TypeDescription
floatThe value entered by the user