marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
8k stars 284 forks source link

feat(image): add caption support to mo.image #2817

Closed metaboulie closed 2 weeks ago

metaboulie commented 2 weeks ago

📝 Summary

fixes #2732

Add optional caption parameter to mo.image() that displays descriptive text below the image using the muted foreground color from the theme. Captions are center-aligned and maintain proper spacing.

Screenshot 2024-11-08 at 13 23 16

📋 Checklist

📜 Reviewers

@akshayka OR @mscolnick

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 9:25am
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 9:25am
hkrutzer commented 2 weeks ago

Could also consider figcaption

mscolnick commented 2 weeks ago

@metaboulie, i think @hkrutzer's recommendation is a good one, and we can change the div's to figure/figurecaption

metaboulie commented 2 weeks ago

@mscolnick To use figure/figurecaption, I added two methods in _HTMLBuilder, hope this is correct

github-actions[bot] commented 2 weeks ago

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.9.18-dev1