formcontrol.py 1001 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. """Form components."""
  2. from pynecone.components.libs.chakra import ChakraComponent
  3. from pynecone.var import Var
  4. class FormControl(ChakraComponent):
  5. """Provide context to form components."""
  6. tag = "FormControl"
  7. # If true, the form control will be disabled.
  8. is_disabled: Var[bool]
  9. # If true, the form control will be invalid.
  10. is_invalid: Var[bool]
  11. # If true, the form control will be readonly
  12. is_read_only: Var[bool]
  13. # If true, the form control will be required.
  14. is_required: Var[bool]
  15. # The label text used to inform users as to what information is requested for a text field.
  16. label: Var[str]
  17. class FormHelperText(ChakraComponent):
  18. """A form helper text component."""
  19. tag = "FormHelperText"
  20. class FormLabel(ChakraComponent):
  21. """A form label component."""
  22. tag = "FormLabel"
  23. # Link
  24. html_for: Var[str]
  25. class FormErrorMessage(ChakraComponent):
  26. """A form error message component."""
  27. tag = "FormErrorMessage"