2026-10-03 12:01:42 +02:00
|
|
|
@inherits DComponentBase
|
|
|
|
|
|
|
|
|
|
@* daisyUI Hover gallery: https://daisyui.com/components/hover-gallery/ . Shows the first image; moving the pointer
|
|
|
|
|
across it shows the others. Up to 10 images of the same size, from Images or as <img> children; cap its width in
|
|
|
|
|
Class (max-w-60), or it fills the container. *@
|
|
|
|
|
<figure @attributes="AdditionalAttributes" class="@Cx("hover-gallery", Class)">
|
|
|
|
|
@if (Images is not null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var src in Images.Take(10))
|
|
|
|
|
{
|
|
|
|
|
<img src="@src" alt="@Alt" />
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ChildContent
|
|
|
|
|
</figure>
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
[Parameter] public IEnumerable<string> Images { get; set; }
|
2026-10-03 15:26:21 +02:00
|
|
|
// "" on purpose (the documented exception to "no string defaults"): an empty alt marks a decorative image.
|
2026-10-03 12:01:42 +02:00
|
|
|
[Parameter] public string Alt { get; set; } = "";
|
|
|
|
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
|
|
|
|
}
|