22 lines
738 B
Plaintext
22 lines
738 B
Plaintext
@inherits DComponentBase
|
|||
|
|
|
||
|
|
@* daisyUI Carousel: https://daisyui.com/components/carousel/ . A scroll-snap strip of DCarouselItem children; the
|
||
|
|
user scrolls or swipes it. Give each item w-full for one slide at a time. *@
|
||
|
|
<div @attributes="AdditionalAttributes" class="@CssClass">
|
||
|
|
@ChildContent
|
||
|
|
</div>
|
||
|
|
|
||
|
|
@code {
|
||
|
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
||
|
|
[Parameter] public DCarouselSnap Snap { get; set; }
|
||
|
|
[Parameter] public DDirection Direction { get; set; }
|
||
|
|
|
||
|
|
string CssClass => Cx("carousel", SnapClass, Direction == DDirection.Vertical ? "carousel-vertical" : null, Class);
|
||
|
|
|
||
|
|
string SnapClass => Snap switch
|
||
|
|
{
|
||
|
|
DCarouselSnap.Center => "carousel-center",
|
||
|
|
DCarouselSnap.End => "carousel-end",
|
||
|
|
_ => null
|
||
|
|
};
|
||
|
|
}
|