https://github.com/benitmulindwa/flet_gradient_text
A flet component that makes it easy to create gradient text and animated gradient text.
https://github.com/benitmulindwa/flet_gradient_text
animated-gradient-text flet flet-gradient gradient-text python
Last synced: 3 months ago
JSON representation
A flet component that makes it easy to create gradient text and animated gradient text.
- Host: GitHub
- URL: https://github.com/benitmulindwa/flet_gradient_text
- Owner: Benitmulindwa
- License: mit
- Created: 2025-05-26T22:59:15.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-31T23:23:48.000Z (about 1 year ago)
- Last Synced: 2025-11-18T04:12:34.751Z (7 months ago)
- Topics: animated-gradient-text, flet, flet-gradient, gradient-text, python
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flet_gradient_text
It displays text with a colorful gradient and optional animation of the gradient.
#
## installation:
```bash
pip install flet_gradient_text
```
## 🔧 Parameters
- `text`(str): The text content to display
- `text_size`(optional): default `text_size=20`, Font size of the text
- `text_weight`: optional, Font weight (e.g., ft.FontWeight.BOLD)
- `text_style`(optional): property of type `ft.TextStyle`
- `animate` (bool): default `animate=False`, `True` to Enable animation
- `duration`(float or int): default `duration=0.5`, Controls the speed of the animation
- `gradient`: (optional) Custom gradient to apply over the text, default `LinearGradient`
- `on_click`(optional): Event handler when the text is clicked
- `on_hover`(optional): Event handler when hovering over the text
## 🧩 Usage
```python
import flet as ft
from flet_gradient_text import GradientText
def main(page: ft.Page):
page.add(
GradientText(
text="Hello Gradient!",
text_size=40,
text_weight=ft.FontWeight.BOLD,
animate=True,
duration=1,
)
)
ft.app(target=main)
```