Timelines control for Flet
Project description
flet-timelines
A powerful Timeline control for Flet that allows you to create beautiful, customizable timelines in your Flet applications.
Features
- Multiple timeline types (Basic and Style-Based)
- Various content alignments (Basic, Reverse, Alternating)
- Customizable indicators and connectors
- Flexible styling options
- Responsive design
Installation
Add dependency to pyproject.toml of your Flet app:
dependencies = [
"flet-timelines",
"flet>=0.27.6",
]
Basic Usage
Here's a simple example of how to create a basic timeline:
from flet_timelines import Timeline, TimelineType, ContentsAlign
import flet as ft
def main(page: ft.Page):
# Create timeline items
items = [
ft.Container(
content=ft.Card(
content=ft.Container(
content=ft.Column([
ft.Text("Event 1", weight="bold"),
ft.Text("Description of event 1")
]),
padding=10
)
),
width=200
),
ft.Container(
content=ft.Card(
content=ft.Container(
content=ft.Column([
ft.Text("Event 2", weight="bold"),
ft.Text("Description of event 2")
]),
padding=10
)
),
width=200
)
]
# Create timeline
timeline = Timeline(
items=items,
timeline_type=TimelineType.BASIC,
contents_align=ContentsAlign.BASIC,
color=ft.colors.BLUE,
indicator_size=20,
expand=True
)
page.add(timeline)
ft.app(main)
Timeline Types
Basic Timeline
The basic timeline provides a simple, clean layout with customizable indicators and connectors.
Timeline(
items=items,
timeline_type=TimelineType.BASIC,
contents_align=ContentsAlign.BASIC
)
Style-Based Timeline
The style-based timeline offers advanced styling options for indicators, connectors, and spacing.
Timeline(
items=items,
timeline_type=TimelineType.STYLE_BASED,
contents_align=ContentsAlign.ALTERNATING,
connector_style=ConnectorStyle.DASHED,
indicator_style=IndicatorStyle.OUTLINED
)
Content Alignment
ContentsAlign.BASIC: Items aligned on one sideContentsAlign.REVERSE: Items aligned on the opposite sideContentsAlign.ALTERNATING: Items alternate between sides
API Reference
Timeline Properties
Basic Properties
items: List of Control objects to display in the timelinetimeline_type: Type of timeline (TimelineType.BASIC or TimelineType.STYLE_BASED)contents_align: Alignment of timeline items (ContentsAlign.BASIC, REVERSE, or ALTERNATING)color: Color of the timeline indicators and connectorsindicator_size: Size of the timeline indicators
Style-Based Properties
connector_style: Style of connectors (ConnectorStyle.SOLID, DASHED, or DECORATED)connector_thickness: Thickness of connector linesconnector_space: Space between connector and contentconnector_indent: Indentation of connectorsindicator_style: Style of indicators (IndicatorStyle.DOT, OUTLINED, CONTAINER, or TRANSPARENT)indicator_position: Position of indicatorsnode_position: Position of nodesnode_align: Alignment of nodes (TimelineNodeAlign.START, END, or BASIC)connection_direction: Direction of connections (ConnectionDirection.BEFORE or AFTER)dash_size: Size of dashes in dashed connector stylegap_size: Size of gaps between dashesgap_color: Color of gaps in dashed connector style
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flet_timelines-0.1.2.tar.gz.
File metadata
- Download URL: flet_timelines-0.1.2.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1371ee8e603db5303cfff0af5914cbe28646d4e20773310ab04d5abad0446ae3
|
|
| MD5 |
b2ad09ddb3a5293fa79c6422b7ae6fdb
|
|
| BLAKE2b-256 |
09b4d02324539128216d63db5298b832f33c4052fa9c46e47b16ff3b63b59658
|
File details
Details for the file flet_timelines-0.1.2-py3-none-any.whl.
File metadata
- Download URL: flet_timelines-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed9ad3dae792709770e37851db6eadc38541b4e416205e3c3e09cbf7f1b9dac8
|
|
| MD5 |
51f4778a63cfbab57569ddf1f14226bd
|
|
| BLAKE2b-256 |
5bfe3f6f17a32c4b3124625d1cc3dbdf739b5ec10daf28cba0c25e2921534213
|