widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.9k stars 140 forks source link

Issue with Chatbox Avatar Display #691

Open OtokoNoIzumi opened 4 months ago

OtokoNoIzumi commented 4 months ago

image I've encountered a display issue with the chatbox avatar in our application that I'm hoping you can help with. There appears to be consistent blank spaces on the left and top sides of the avatar image within the chatbox.

iisakkirotko commented 4 months ago

Thanks a lot for opening the issue @OtokoNoIzumi!

In case anyone ends up here via google, here's the solution for now:

with solara.v.Avatar(color='#ff991f', size=400):
    solara.HTML(tag="img", attributes={"src": 'https://picsum.photos/400', "width": "100%"})

You can see it live here.

A proper solution to this in Solara would require some (visually) breaking changes, so we hope to include it in Solara 2.0. Until then the above workaround should suffice.