stat.py 910 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. """Statistics components."""
  2. from pynecone.components.libs.chakra import ChakraComponent
  3. from pynecone.var import Var
  4. class Stat(ChakraComponent):
  5. """The Stat component is used to display some statistics. It can take in a label, a number and a help text."""
  6. tag = "Stat"
  7. class StatLabel(ChakraComponent):
  8. """A stat label component."""
  9. tag = "StatLabel"
  10. class StatNumber(ChakraComponent):
  11. """The stat to display."""
  12. tag = "StatNumber"
  13. class StatHelpText(ChakraComponent):
  14. """A helper text to display under the stat."""
  15. tag = "StatHelpText"
  16. class StatArrow(ChakraComponent):
  17. """A stat arrow component indicating the direction of change."""
  18. tag = "StatArrow"
  19. # The type of arrow, either increase or decrease.
  20. type_: Var[str]
  21. class StatGroup(ChakraComponent):
  22. """A stat group component to evenly space out the stats."""
  23. tag = "StatGroup"