base.py 931 B

12345678910111213141516171819202122232425262728
  1. """Declarative layout and common spacing props."""
  2. from __future__ import annotations
  3. from typing import Literal
  4. from reflex.components.core.breakpoints import Responsive
  5. from reflex.components.radix.themes.base import (
  6. CommonMarginProps,
  7. CommonPaddingProps,
  8. RadixThemesComponent,
  9. )
  10. from reflex.vars.base import Var
  11. LiteralBoolNumber = Literal["0", "1"]
  12. class LayoutComponent(CommonMarginProps, CommonPaddingProps, RadixThemesComponent):
  13. """Box, Flex and Grid are foundational elements you'll use to construct
  14. layouts. Box provides block-level spacing and sizing, while Flex and Grid
  15. let you create flexible columns, rows and grids.
  16. """
  17. # Whether the element will take up the smallest possible space: "0" | "1"
  18. flex_shrink: Var[Responsive[LiteralBoolNumber]]
  19. # Whether the element will take up the largest possible space: "0" | "1"
  20. flex_grow: Var[Responsive[LiteralBoolNumber]]