Figures
Image containers with optional captions for visual content presentation. Perfect for displaying photos, illustrations, or graphics with descriptive text in articles, galleries, and documentation.
Basic Figure
Figures are used to display images with optional captions. They are commonly used within cards and other content containers. By default, images appear above the content.


= daisy_figure(css: "max-w-96", src: image_path("landscapes/beach.jpg"))
Figure with Caption
You can add a caption to your figure by providing content to the component.
The image appears above the caption by default (position: :top).

A beautiful mountain river landscape

A beautiful mountain river landscape
= daisy_figure(css: "max-w-96", src: image_path("landscapes/mountain-river.jpg")) do
%p.text-center.italic A beautiful mountain river landscape
Figure with Bottom Position
Use position: :bottom to display the caption above the image. This is
useful when you want the text to appear first in the reading flow.
A serene forest pathway

A serene forest pathway

= daisy_figure(css: "max-w-96", src: image_path("landscapes/forest.jpg"), position: :bottom) do
%p.text-center.italic A serene forest pathway
Custom Content
Figures can also be used without an image to display custom content.
Custom content without an image
Custom content without an image
= daisy_figure(css: "max-w-96 bg-base-100 border border-base-300 p-4 rounded-lg") do
.flex.flex-col.items-center.gap-4
= loco_icon("photo", css: "size-16 text-base-content/50")
%p.text-center.italic Custom content without an image