reflex/pynecone/components/forms/formcontrol.py
Nikhil Rao 7ec4b3f8fe
Improve component docs (#35)
* Update component docstrings
* Remove transitions libs
* Add span component
* Add lock files
2022-12-07 15:04:49 -08:00

47 lines
1001 B
Python

"""Form components."""
from pynecone.components.libs.chakra import ChakraComponent
from pynecone.var import Var
class FormControl(ChakraComponent):
"""Provide context to form components."""
tag = "FormControl"
# If true, the form control will be disabled.
is_disabled: Var[bool]
# If true, the form control will be invalid.
is_invalid: Var[bool]
# If true, the form control will be readonly
is_read_only: Var[bool]
# If true, the form control will be required.
is_required: Var[bool]
# The label text used to inform users as to what information is requested for a text field.
label: Var[str]
class FormHelperText(ChakraComponent):
"""A form helper text component."""
tag = "FormHelperText"
class FormLabel(ChakraComponent):
"""A form label component."""
tag = "FormLabel"
# Link
html_for: Var[str]
class FormErrorMessage(ChakraComponent):
"""A form error message component."""
tag = "FormErrorMessage"