alert.py 769 B

12345678910111213141516171819202122232425262728293031323334
  1. """Alert components."""
  2. from pynecone.components.libs.chakra import ChakraComponent
  3. from pynecone.var import Var
  4. class Alert(ChakraComponent):
  5. """Container to stack elements with spacing."""
  6. tag = "Alert"
  7. # The status of the alert ("success" | "info" | "warning" | "error")
  8. status: Var[str]
  9. # "subtle" | "left-accent" | "top-accent" | "solid"
  10. variant: Var[str]
  11. class AlertIcon(ChakraComponent):
  12. """AlertIcon composes Icon and changes the icon based on the status prop."""
  13. tag = "AlertIcon"
  14. class AlertTitle(ChakraComponent):
  15. """AlertTitle composes the Box component."""
  16. tag = "AlertTitle"
  17. class AlertDescription(ChakraComponent):
  18. """AlertDescription composes the Box component."""
  19. tag = "AlertDescription"