base.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. """Declarative layout and common spacing props."""
  2. from __future__ import annotations
  3. from typing import Literal
  4. from reflex.vars import Var
  5. from ..base import (
  6. CommonMarginProps,
  7. LiteralSize,
  8. RadixThemesComponent,
  9. )
  10. LiteralBoolNumber = Literal["0", "1"]
  11. class LayoutComponent(CommonMarginProps, RadixThemesComponent):
  12. """Box, Flex and Grid are foundational elements you'll use to construct
  13. layouts. Box provides block-level spacing and sizing, while Flex and Grid
  14. let you create flexible columns, rows and grids.
  15. """
  16. # Padding: "0" - "9"
  17. p: Var[LiteralSize]
  18. # Padding horizontal: "0" - "9"
  19. px: Var[LiteralSize]
  20. # Padding vertical: "0" - "9"
  21. py: Var[LiteralSize]
  22. # Padding top: "0" - "9"
  23. pt: Var[LiteralSize]
  24. # Padding right: "0" - "9"
  25. pr: Var[LiteralSize]
  26. # Padding bottom: "0" - "9"
  27. pb: Var[LiteralSize]
  28. # Padding left: "0" - "9"
  29. pl: Var[LiteralSize]
  30. # Whether the element will take up the smallest possible space: "0" | "1"
  31. shrink: Var[LiteralBoolNumber]
  32. # Whether the element will take up the largest possible space: "0" | "1"
  33. grow: Var[LiteralBoolNumber]