Current section
Files
Jump to
Current section
Files
lib/pyraui_web/live/docs/timeline_docs.ex
defmodule PyrauiWeb.DocsLive.TimelineDocs do
use PyrauiWeb, :html
def render(assigns) do
~H"""
<div class="text-gray-900 dark:text-gray-100">
<h1 class="text-4xl font-bold mb-4 text-gray-900 dark:text-gray-100">Timeline</h1>
<div class="mb-8">
<p class="text-gray-700 dark:text-gray-300 text-lg">
Timeline component for displaying chronological events or activities with support for nested/collapsible events.
</p>
</div>
<div class="space-y-8">
<section>
<h2 class="text-2xl font-semibold mb-4 text-gray-900 dark:text-gray-100">Basic Timeline</h2>
<div class="bg-white dark:bg-gray-800 p-6 rounded-lg border border-gray-200 dark:border-gray-700 mb-4 shadow-sm">
<Pyraui.Components.Timeline.timeline
id="timeline-basic"
items={@sample_items}
variant={:vertical}
/>
</div>
<div class="bg-gray-100 dark:bg-gray-900 p-4 rounded-lg overflow-x-auto border border-gray-200 dark:border-gray-700">
<pre class="text-gray-800 dark:text-gray-200"><code phx-no-curly-interpolation>
<.timeline id="events-timeline" items={@events} />
</code></pre>
</div>
</section>
<section>
<h2 class="text-2xl font-semibold mb-4 text-gray-900 dark:text-gray-100">
Nested Events with Collapsible
</h2>
<div class="bg-white dark:bg-gray-800 p-6 rounded-lg border border-gray-200 dark:border-gray-700 mb-4 shadow-sm">
<Pyraui.Components.Timeline.timeline
id="timeline-nested"
items={@nested_items}
collapsible={true}
/>
</div>
<div class="bg-gray-100 dark:bg-gray-900 p-4 rounded-lg overflow-x-auto border border-gray-200 dark:border-gray-700">
<pre class="text-gray-800 dark:text-gray-200"><code phx-no-curly-interpolation>
<.timeline
id="nested-timeline"
items={@events}
collapsible={true}
default_expanded={true}
/>
</code></pre>
</div>
</section>
<section>
<h2 class="text-2xl font-semibold mb-4 text-gray-900 dark:text-gray-100">
Horizontal Timeline
</h2>
<div class="bg-white dark:bg-gray-800 p-6 rounded-lg border border-gray-200 dark:border-gray-700 mb-4 shadow-sm overflow-x-auto">
<Pyraui.Components.Timeline.timeline
id="timeline-horizontal"
items={Enum.take(@sample_items, 3)}
variant={:horizontal}
/>
</div>
</section>
</div>
</div>
"""
end
end