reflex/pynecone/components/layout/box.py
Nikhil Rao 7ec4b3f8fe
Improve component docs (#35)
* Update component docstrings
* Remove transitions libs
* Add span component
* Add lock files
2022-12-07 15:04:49 -08:00

34 lines
797 B
Python

"""A box component that can contain other components."""
from typing import Optional
from pynecone.components.libs.chakra import ChakraComponent
from pynecone.components.tags import Tag
from pynecone.var import Var
class Box(ChakraComponent):
"""A generic container component that can contain other components."""
tag = "Box"
# The type element to render. You can specify as 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,
}
)
)