reflex/reflex/components/chakra/layout/box.py
Alek Petuskey 00a8054850
Individually Import Chakra Packages (#2405)
* Base lib switch

Co-authored-by: Alek Petuskey <alekpetuskey@aleks-mbp.lan>
2024-01-25 10:22:46 -08:00

33 lines
780 B
Python

"""A box component that can contain other components."""
from reflex.components.chakra.layout.base import ChakraLayoutComponent
from reflex.components.tags import Tag
from reflex.vars import Var
class Box(ChakraLayoutComponent):
"""A generic container component that can contain other components."""
tag = "Box"
# The type element to render. You can specify an image, video, or any other HTML element such as iframe.
element: Var[str]
# The source of the content.
src: Var[str]
# The alt text of the content.
alt: Var[str]
def _render(self) -> Tag:
return (
super()
._render()
.add_props(
**{
"as": self.element,
}
)
)