Files
decePubClient/Components/Daisy/DataDisplay/DTimeline.razor
T

21 lines
1.1 KiB
Plaintext
Raw Normal View History

@inherits DComponentBase
@* daisyUI Timeline: https://daisyui.com/components/timeline/ . Horizontal unless Direction is Vertical (for a
responsive switch add lg:timeline-horizontal in Class). Every DTimelineItem draws its connecting <hr> on both
sides; the two arbitrary variants here hide the outer ends, so the line runs only between items. *@
<ul @attributes="AdditionalAttributes" class="@CssClass">
@ChildContent
</ul>
@code {
[Parameter] public RenderFragment ChildContent { get; set; }
[Parameter] public DDirection Direction { get; set; }
/// <summary>Put every item on one side of the line (timeline-compact).</summary>
[Parameter] public bool Compact { get; set; }
/// <summary>Align the icon with the start of the content instead of its middle (timeline-snap-icon).</summary>
[Parameter] public bool SnapIcon { get; set; }
string CssClass => Cx("timeline", Direction == DDirection.Vertical ? "timeline-vertical" : null,
Compact ? "timeline-compact" : null, SnapIcon ? "timeline-snap-icon" : null,
"[&>li:first-child>hr:first-child]:hidden [&>li:last-child>hr:last-child]:hidden", Class);
}