Build a timeline view in Bubble using a Repeating Group with date-sorted entries and alternating left-right styling. This tutorial shows how to create both vertical and horizontal timelines by connecting events from a database, adding connector lines with CSS, and displaying expandable detail cards.
Overview: Timeline Views in Bubble
A timeline view displays events or milestones in chronological order with visual connectors. It is commonly used for project tracking, company histories, or user activity feeds. This tutorial builds a vertical timeline using Bubble's Repeating Group and CSS styling for the connector lines and alternating layout.
Prerequisites
- A Bubble account with an app
- Basic understanding of Repeating Groups and Data Types
- Familiarity with HTML elements for custom CSS styling
Step-by-step guide
Create the TimelineEvent data type
Create the TimelineEvent data type
Go to Data tab and create a 'TimelineEvent' Data Type with fields: title (text), description (text), event_date (date), icon (text — for emoji or icon name), color (text — hex color code), and user (User — optional, for user-specific timelines). Add sample data with 5-6 events at different dates.
Expected result: A TimelineEvent Data Type exists with sample records spanning different dates.
Build the vertical timeline with a Repeating Group
Build the vertical timeline with a Repeating Group
On your page, add a Repeating Group with data source: Do a search for TimelineEvent, sorted by event_date ascending. Set the cell height to auto (Fit height to content). In each cell, add a Row container with three Groups: left content (40% width), center connector (20% width), and right content (40% width). In the left group, display the formatted date. In the center group, add a small circle icon. In the right group, display the title and description.
Expected result: Events display in chronological order with date on the left, a center marker, and content on the right.
Add connector lines between events using CSS
Add connector lines between events using CSS
Add an HTML element inside the center Group of each Repeating Group cell. This HTML element draws a vertical line connecting the circle markers. The line should extend from the top to the bottom of each cell, creating a continuous visual timeline. Style the circle marker with a colored border and the line with a thin solid border.
1<style>2 .timeline-connector {3 width: 2px;4 background-color: #3B82F6;5 height: 100%;6 margin: 0 auto;7 position: relative;8 }9 .timeline-dot {10 width: 16px;11 height: 16px;12 border-radius: 50%;13 background-color: #3B82F6;14 border: 3px solid #ffffff;15 box-shadow: 0 0 0 2px #3B82F6;16 margin: 0 auto;17 position: relative;18 z-index: 1;19 }20</style>21<div class="timeline-connector">22 <div class="timeline-dot"></div>23</div>Expected result: A vertical line connects all timeline entries with colored dot markers at each event.
Add alternating left-right layout
Add alternating left-right layout
To create the classic alternating timeline, use conditional formatting based on the cell index. Add a conditional on the left content Group: When Current cell's index is even → visible = no, Collapse when hidden = checked. Add the opposite conditional on the right content Group. Then duplicate the content to the other side. This creates alternating left-right content placement. On mobile, hide the alternating layout and show all content on one side.
Pro tip: Use Current cell's index modulo 2 to determine even/odd positioning for the alternating pattern.
Expected result: Timeline entries alternate between left and right sides of the connector line.
Add expandable detail cards
Add expandable detail cards
Make each timeline entry clickable to reveal more details. Add a hidden Group below the title/description in each cell containing additional information (full description, images, links). Add a custom state 'expanded_event' on the page (type: TimelineEvent). When a timeline entry is clicked: Set state of page → expanded_event = Current cell's TimelineEvent. On the detail Group: Conditional: When page's expanded_event is Current cell's TimelineEvent → visible = yes.
Expected result: Clicking a timeline entry expands it to show full details, clicking again or clicking another entry collapses it.
Complete working example
1TIMELINE VIEW — SETUP SUMMARY2===============================34DATA TYPE:5 TimelineEvent: title, description, event_date, icon, color, user67PAGE STRUCTURE:8 Repeating Group (search: TimelineEvent sorted by event_date)9 └── Each cell: Row container10 ├── Left Content Group (40%)11 │ - Date (formatted)12 │ - Title + description (odd rows)13 ├── Center Connector Group (20%)14 │ - HTML element with vertical line + dot15 └── Right Content Group (40%)16 - Title + description (even rows)17 - Expandable detail card (hidden by default)1819ALTERNATING LAYOUT:20 Left content: visible when cell index is odd21 Right content: visible when cell index is even22 Mobile: all content on right side (left hidden)2324EXPANDABLE DETAILS:25 Custom state: expanded_event (TimelineEvent)26 Click event: Set state → expanded_event = clicked event27 Detail Group: visible when expanded_event = Current cell's event2829CONNECTOR CSS:30 Vertical line: 2px wide, centered in middle column31 Dot marker: 16px circle with border and shadowCommon mistakes when making a timeline view in Bubble.io: Step-by-Step Guide
Why it's a problem: Not sorting the Repeating Group by event_date
How to avoid: Always set the Repeating Group sort to event_date ascending (or descending for reverse chronology)
Why it's a problem: Using fixed cell heights instead of fit-to-content
How to avoid: Set the Repeating Group cell to 'Fit height to content' so each entry is as tall as its content requires
Why it's a problem: Forgetting to hide the alternating layout on mobile
How to avoid: Add a mobile breakpoint conditional that shows all content on one side and hides the empty alternating column
Best practices
- Sort timeline events by date ascending for chronological display
- Use fit-to-content cell heights for variable-length entries
- Add color coding by event type or category for visual variety
- Collapse the alternating layout to a single column on mobile screens
- Paginate long timelines to 10-15 events per page with a 'Load more' button
- Use Option Sets for event categories to enable color-coded markers
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I want to build a vertical timeline in Bubble.io that displays events in chronological order with alternating left-right positioning and a connecting line between entries. Can you describe the element structure and CSS needed?
Create a vertical timeline view on this page. Add a TimelineEvent data type and display events in chronological order with a center connector line, dot markers, and alternating left-right content layout.
Frequently asked questions
Can I make a horizontal timeline instead of vertical?
Yes. Use a horizontal Repeating Group (set to Row layout) with each cell containing a vertical stack of marker, connector line, and content. Horizontal scrolling works well for fixed-date timelines.
How do I filter the timeline by date range?
Add two Date Pickers for start and end dates above the timeline. Use their values as constraints on the Repeating Group search: event_date >= start date AND event_date <= end date.
Can I add images to timeline entries?
Yes. Add an image field to TimelineEvent and display it inside each timeline card. Use conditional visibility to only show the Image element when the field is not empty.
How many events can the timeline handle?
For display, paginate to 10-15 events per page. The database can handle thousands of TimelineEvent records, but rendering them all at once would slow the page.
Can users add events to the timeline?
Yes. Add a form with inputs for title, description, and date. The submit workflow creates a new TimelineEvent. The Repeating Group updates automatically to show the new entry.
Can RapidDev build a custom timeline feature?
Yes. RapidDev builds interactive timelines with drag-to-reorder, zoom controls, milestone markers, and integration with project management workflows.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation