Images & SVG¶
Void provides styled image handling and a flexible way to embed SVG content, all driven by the standard attr_list extension so you can attach component classes directly to Markdown images.
Standard images¶
Images get the glass treatment automatically: rounded corners, subtle border, and maximum width constraint.
{ width="120" }
Image lightbox¶
Click any content image (not wrapped in a link) to open a full-viewport preview
overlay. Close with the Γ button, clicking the backdrop, the Esc key, or
scrolling; navigate multiple openable images with the β / β arrow keys. The
overlay works with zero dependencies β no extra pip packages.
- Images inside a
<a>(e.g. linked thumbnails) are deliberately left alone. - The overlay respects
prefers-reduced-motionand locks body scroll while open.
Image classes via attr_list¶
Attach any class directly to an image with the {.class} suffix β no HTML needed:
| Class | Effect |
|---|---|
void-img-round |
Circular crop |
void-img-ghost |
Dimmed/desaturated |
void-image--banner |
Full-width banner (max-height 380px, cover) |
void-image--thumbnail |
Small 220px thumbnail |
{ .void-img-round width="140" }
{ .void-img-ghost }
{ .void-image--banner }
Figure with caption¶
Use a small HTML <figure> for images with captions:
<figure class="void-figure">
<img src="https://raw.githubusercontent.com/rkriad585/mkdocs-void/main/docs/assets/images/logo.svg" alt="Void logo" width="96">
<figcaption>Figure 1 β The Void logo</figcaption>
</figure>
Inline SVG component¶
Wrap raw SVG in a .void-svg container to get a bordered glass panel that centers and scrolls the artwork:
Use void-svg--bare for a borderless, transparent container when you don't want the glass panel look.
Dividers & badges¶
A decorative divider component:
Status badges: