wrap.py 856 B

12345678910111213141516171819202122232425262728293031323334353637
  1. """Container to stack elements with spacing."""
  2. from pynecone.components.libs.chakra import ChakraComponent
  3. from pynecone.var import Var
  4. class Wrap(ChakraComponent):
  5. """Layout component used to add space between elements and wrap automatically if there isn't enough space."""
  6. tag = "Wrap"
  7. # How to align the items.
  8. align: Var[str]
  9. # The flex direction of the wrap.
  10. direction: Var[str]
  11. # How to justify the items.
  12. justify: Var[str]
  13. # Whether to wrap children in `pc.wrap_item`.
  14. should_wrap_children: Var[bool]
  15. # The spacing between the items.
  16. spacing: Var[str]
  17. # The horizontal spacing between the items.
  18. spacing_x: Var[str]
  19. # The vertical spacing between the items.
  20. spacing_y: Var[str]
  21. class WrapItem(ChakraComponent):
  22. """Item of the Wrap component."""
  23. tag = "WrapItem"