Utilities
Timeline
A visual representation of events in chronological order.
Installation
Copy the following code into your app directory.
Command
Command
Manual
Manual
uv
uv run buridan add component timelinefrom components.ui.timeline import timelinetimeline.root(
timeline.item(
timeline.indicator(),
timeline.separator(),
timeline.header(
timeline.date(),
timeline.title(),
),
timeline.content(),
),
)
Project kickoff
Initial planning and team onboarding.
Design phase
Wireframes and prototypes completed.
Development
Core features implemented.
Launch
Public release.
from components.ui.timeline import timeline
def timeline_basic():
return timeline.root(
timeline.item(
timeline.indicator(),
timeline.separator(),
timeline.header(
timeline.date(
"Jan 2024",
class_name="sm:group-data-[orientation=vertical]/timeline:absolute sm:group-data-[orientation=vertical]/timeline:-left-32 sm:group-data-[orientation=vertical]/timeline:w-20 sm:group-data-[orientation=vertical]/timeline:text-right",
),
timeline.title("Project kickoff"),
),
timeline.content("Initial planning and team onboarding."),
step=1,
active_step=3,
),
timeline.item(
timeline.indicator(),
timeline.separator(),
timeline.header(
timeline.date("Feb 2024"),
timeline.title("Design phase"),
),
timeline.content("Wireframes and prototypes completed."),
step=2,
active_step=3,
),
timeline.item(
timeline.indicator(),
timeline.separator(),
timeline.header(
timeline.date("Mar 2024"),
timeline.title("Development"),
),
timeline.content("Core features implemented."),
step=3,
active_step=3,
),
timeline.item(
timeline.indicator(),
timeline.separator(),
timeline.header(
timeline.date("Apr 2024"),
timeline.title("Launch"),
),
timeline.content("Public release."),
step=4,
active_step=3,
),
orientation="vertical",
)Left-Aligned Dates
Set the data-[] CSS prop to -left-32 to align dates to the left.
Project kickoff
Initial planning and team onboarding.
Design phase
Wireframes and prototypes completed.
Development
Core features implemented.
Launch
Public release.
from components.ui.timeline import timeline
left_align_date = "sm:group-data-[orientation=vertical]/timeline:absolute sm:group-data-[orientation=vertical]/timeline:-left-32 sm:group-data-[orientation=vertical]/timeline:w-20 sm:group-data-[orientation=vertical]/timeline:text-right"
def timeline_left_aligned_dates():
return timeline.root(
timeline.item(
timeline.indicator(),
timeline.separator(),
timeline.header(
timeline.date("Jan 2024", class_name=left_align_date),
timeline.title("Project kickoff"),
),
timeline.content("Initial planning and team onboarding."),
step=1,
active_step=3,
),
timeline.item(
timeline.indicator(),
timeline.separator(),
timeline.header(
timeline.date("Feb 2024", class_name=left_align_date),
timeline.title("Design phase"),
),
timeline.content("Wireframes and prototypes completed."),
step=2,
active_step=3,
),
timeline.item(
timeline.indicator(),
timeline.separator(),
timeline.header(
timeline.date("Mar 2024", class_name=left_align_date),
timeline.title("Development"),
),
timeline.content("Core features implemented."),
step=3,
active_step=3,
),
timeline.item(
timeline.indicator(),
timeline.separator(),
timeline.header(
timeline.date("Apr 2024", class_name=left_align_date),
timeline.title("Launch"),
),
timeline.content("Public release."),
step=4,
active_step=3,
),
orientation="vertical",
)API Reference
timeline.root
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "horizontal" | "vertical" | "vertical" | Controls whether timeline items render vertically or horizontally. |
| class_name | str | "" | Additional classes applied to the root container. |
| **props | Any | — | Additional props forwarded to the underlying div. |
timeline.item
| Prop | Type | Default | Description |
|---|---|---|---|
| step | int | — | Step number for the item. |
| active_step | int | — | Current active step used to determine completion state. |
| class_name | str | "" | Additional classes applied to the item container. |
| **props | Any | — | Additional props forwarded to the underlying div. |
timeline.header
| Prop | Type | Default | Description |
|---|---|---|---|
| class_name | str | "" | Additional classes applied to the header. |
| **props | Any | — | Additional props forwarded to the underlying div. |
timeline.title
| Prop | Type | Default | Description |
|---|---|---|---|
| class_name | str | "" | Additional classes applied to the title. |
| **props | Any | — | Additional props forwarded to the underlying h3. |
timeline.content
| Prop | Type | Default | Description |
|---|---|---|---|
| class_name | str | "" | Additional classes applied to the content container. |
| **props | Any | — | Additional props forwarded to the underlying div. |
timeline.date
| Prop | Type | Default | Description |
|---|---|---|---|
| class_name | str | "" | Additional classes applied to the date element. |
| **props | Any | — | Additional props forwarded to the underlying time. |
timeline.indicator
| Prop | Type | Default | Description |
|---|---|---|---|
| class_name | str | "" | Additional classes applied to the indicator. |
| aria_hidden | bool | True | Hidden from assistive technologies. |
| **props | Any | — | Additional props forwarded to the underlying div. |
timeline.separator
| Prop | Type | Default | Description |
|---|---|---|---|
| class_name | str | "" | Additional classes applied to the separator. |
| aria_hidden | bool | True | Hidden from assistive technologies. |
| **props | Any | — | Additional props forwarded to the underlying div. |