inset.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. """Interactive components provided by @radix-ui/themes."""
  2. from typing import Literal, Optional, Union
  3. from reflex import el
  4. from reflex.vars import Var
  5. from ..base import (
  6. RadixThemesComponent,
  7. )
  8. LiteralButtonSize = Literal["1", "2", "3", "4"]
  9. class Inset(el.Div, RadixThemesComponent):
  10. """Applies a negative margin to allow content to bleed into the surrounding container."""
  11. tag = "Inset"
  12. # The side
  13. side: Optional[Var[Literal["x", "y", "top", "bottom", "right", "left"]]] = None
  14. # How to clip the element's content: "border-box" | "padding-box"
  15. clip: Optional[Var[Literal["border-box", "padding-box"]]] = None
  16. # Padding
  17. p: Optional[Var[Union[int, str]]] = None
  18. # Padding on the x axis
  19. px: Optional[Var[Union[int, str]]] = None
  20. # Padding on the y axis
  21. py: Optional[Var[Union[int, str]]] = None
  22. # Padding on the top
  23. pt: Optional[Var[Union[int, str]]] = None
  24. # Padding on the right
  25. pr: Optional[Var[Union[int, str]]] = None
  26. # Padding on the bottom
  27. pb: Optional[Var[Union[int, str]]] = None
  28. # Padding on the left
  29. pl: Optional[Var[Union[int, str]]] = None
  30. inset = Inset.create