alert.py 696 B

12345678910111213141516171819202122232425262728293031323334
  1. """Alert components."""
  2. from pynecone.components.libs.chakra import ChakraComponent
  3. from pynecone.var import Var
  4. class Alert(ChakraComponent):
  5. """An alert feedback box."""
  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. """An icon displayed in the alert."""
  13. tag = "AlertIcon"
  14. class AlertTitle(ChakraComponent):
  15. """The title of the alert."""
  16. tag = "AlertTitle"
  17. class AlertDescription(ChakraComponent):
  18. """AlertDescription composes the Box component."""
  19. tag = "AlertDescription"