Skip to main content

CPF Input

CPF number input with validation and masking.

Examples

Basic Example

The following example demonstrate some of the available functionality for read_cpf

from abstra.forms import read_cpf

name = read_cpf("Insert your CPF below")

Parameters

NameDescriptionType
labelThe label to display to the userstr
initial_valueThe initial value to display to the user. Defaults to "".str
invalid_messageThe message to display when the user enters an invalid value. Defaults to None.str
placeholderThe placeholder text to display to the user. Defaults to "000.000.000-00".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
end_programWhether the program should end after the widget is shown. Defaults to False.bool
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
strThe value entered by the user