Added Visually Hidden + Box Video/Iframe (#30)

* Added Visually Hidden + Box Video/frame

Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
This commit is contained in:
Alek Petuskey 2022-12-05 14:22:58 -08:00 committed by GitHub
parent 91bb3f0b26
commit 46ce9a6652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

@ -8,5 +8,6 @@ from .accordion import (
AccordionPanel,
)
from .tabs import Tab, TabList, TabPanel, TabPanels, Tabs
from .visuallyhidden import VisuallyHidden
__all__ = [f for f in dir() if f[0].isupper()] # type: ignore

View File

@ -0,0 +1,9 @@
"""A component to display visually hidden text."""
from pynecone.components.libs.chakra import ChakraComponent
class VisuallyHidden(ChakraComponent):
"""A component that visually hides content while still allowing it to be read by screen readers."""
tag = "VisuallyHidden"

View File

@ -3,6 +3,7 @@
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):
@ -10,9 +11,15 @@ class Box(ChakraComponent):
tag = "Box"
# The element to render.
# 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()