✨ Announcing our seed funding led by Lux Capital! Read more about it on our blog
DocsBlogChangelog

Search documentation...

/

Star

12k+

[ Learn ]

[ Concepts ]

[ Reference ]

Image


The image component can display an image given a src path as an argment. This could either be a local path from the assets folder or an external link.
rx.image(
    src="/reflex_logo.png", width="100px", height="auto"
)
Image composes a box and can be styled simlarly.
rx.image(
    src="/reflex_logo.png",
    width="100px",
    height="auto",
    border_radius="15px 50px",
    border="5px solid #555",
    box_shadow="lg",
)
You can also pass a PIL image object as the src.
=An Unsplash Image
class ImageState(rx.State):
    url = f"https://picsum.photos/id/1/200/300"
    image = Image.open(requests.get(url, stream=True).raw)
rx.vstack(
    rx.image(src=ImageState.image, alt="=An Unsplash Image")
)

Image


Display an image.


← AvatarIcon →

Copyright © 2023 Pynecone, Inc.