Skip to main content

NPS Input

Captures Net Promoter Score feedback with a 0-10 rating scale.

Examples

Basic Example

The following example demonstrate some of the available functionality for read_nps

from abstra.forms import read_nps

ans = read_nps(
"How likely are you to recommend Abstra Cloud?",
min_hint="No way!",
max_hint="Hell yeah!",
)

Parameters

NameDescriptionType
labelThe label to display to the userstr
minMin value accepted by the input. Defaults to 0.int
maxMax value accepted by the input. Defaults to 10.int
min_hintText to display next to the min value. Defaults to "Not at all likely".str
max_hintText to display next to the max value. Defaults to "Extremely likely".str
initial_valueThe initial value to display to the user. Defaults to None.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
intThe value entered by the user