reflex/pynecone/components/layout/box.py
Alek Petuskey 46ce9a6652
Added Visually Hidden + Box Video/Iframe (#30)
* Added Visually Hidden + Box Video/frame

Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
2022-12-05 14:22:58 -08:00

33 lines
814 B
Python

"""A box component that can contain other components."""
from pynecone.components.libs.chakra import ChakraComponent
from pynecone.components.tags import Tag
from pynecone.var import Var
from typing import Optional
class Box(ChakraComponent):
"""Renders a box 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: Optional[str] = None
# The alt text of the content.
alt: Optional[str] = None
def _render(self) -> Tag:
return (
super()
._render()
.add_props(
**{
"as": self.element,
}
)
)