stack.py 994 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. """Container to stack elements with spacing."""
  2. from pynecone.components.libs.chakra import ChakraComponent
  3. from pynecone.var import Var
  4. class Stack(ChakraComponent):
  5. """Container to stack elements with spacing."""
  6. tag = "Stack"
  7. # Shorthand for alignItems style prop
  8. align_items: Var[str]
  9. # The direction to stack the items.
  10. direction: Var[str]
  11. # If true the items will be stacked horizontally.
  12. is_inline: Var[bool]
  13. # Shorthand for justifyContent style prop
  14. justify_content: Var[str]
  15. # If true, the children will be wrapped in a Box, and the Box will take the spacing props
  16. should_wrap_children: Var[bool]
  17. # The space between each stack item
  18. spacing: Var[str]
  19. # Shorthand for flexWrap style prop
  20. wrap: Var[str]
  21. # Alignment of contents.
  22. justify: Var[str]
  23. class Hstack(Stack):
  24. """Stack items horizontally."""
  25. tag = "HStack"
  26. class Vstack(Stack):
  27. """Stack items vertically."""
  28. tag = "VStack"