table.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. """Table components."""
  2. from typing import List
  3. from pynecone.components.libs.chakra import ChakraComponent
  4. from pynecone.var import Var
  5. class Table(ChakraComponent):
  6. """A table component."""
  7. tag = "Table"
  8. # The color scheme of the table
  9. color_scheme: Var[str]
  10. # The variant of the table style to use
  11. variant: Var[str]
  12. # The size of the table
  13. size: Var[str]
  14. # The placement of the table caption.
  15. placement: Var[str]
  16. class Thead(Table):
  17. """A table header component."""
  18. tag = "Thead"
  19. class Tbody(Table):
  20. """A table body component."""
  21. tag = "Tbody"
  22. class Tfoot(Table):
  23. """A table footer component."""
  24. tag = "Tfoot"
  25. class Tr(Table):
  26. """A table row component."""
  27. tag = "Tr"
  28. class Th(ChakraComponent):
  29. """A table header cell component."""
  30. tag = "Th"
  31. # Aligns the cell content to the right.
  32. is_numeric: Var[bool]
  33. class Td(ChakraComponent):
  34. """A table data cell component."""
  35. tag = "Td"
  36. # Aligns the cell content to the right.
  37. is_numeric: Var[bool]
  38. class TableCaption(ChakraComponent):
  39. """A table caption component."""
  40. tag = "TableCaption"
  41. # The placement of the table caption. This sets the `caption-side` CSS attribute.
  42. placement: Var[str]
  43. class TableContainer(ChakraComponent):
  44. """The table container component renders a div that wraps the table component."""
  45. tag = "TableContainer"