{"id":20049625,"url":"https://github.com/bbalduzz/fletmint","last_synced_at":"2025-10-06T21:28:19.993Z","repository":{"id":238996169,"uuid":"798173616","full_name":"Bbalduzz/fletmint","owner":"Bbalduzz","description":"A sharp and modern components library for Flet","archived":false,"fork":false,"pushed_at":"2024-09-29T17:06:09.000Z","size":210,"stargazers_count":115,"open_issues_count":4,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-08-28T21:32:57.348Z","etag":null,"topics":["components","dark-theme","flet","light-theme"],"latest_commit_sha":null,"homepage":"https://fletmint-showcase.fly.dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bbalduzz.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-09T08:38:25.000Z","updated_at":"2025-08-25T13:47:56.000Z","dependencies_parsed_at":"2024-11-13T11:51:26.455Z","dependency_job_id":"7f243006-3410-45b0-bbd4-eebcfc5800c2","html_url":"https://github.com/Bbalduzz/fletmint","commit_stats":null,"previous_names":["bbalduzz/fletmint"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bbalduzz/fletmint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bbalduzz%2Ffletmint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bbalduzz%2Ffletmint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bbalduzz%2Ffletmint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bbalduzz%2Ffletmint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bbalduzz","download_url":"https://codeload.github.com/Bbalduzz/fletmint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bbalduzz%2Ffletmint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278684812,"owners_count":26028150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["components","dark-theme","flet","light-theme"],"created_at":"2024-11-13T11:51:21.369Z","updated_at":"2025-10-06T21:28:19.957Z","avatar_url":"https://github.com/Bbalduzz.png","language":"Python","funding_links":["https://www.patreon.com/edoardobalducci","https://liberapay.com/balduzz/donate","https://www.paypal.com/donate/?hosted_button_id=3C8G7V8DUWLQG","https://ko-fi.com/C0C8T2OJ6"],"categories":[],"sub_categories":[],"readme":"++++\n\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/0895932f-039f-4039-a137-aa634b7da6cc\" alt=\"fletmint logo\" width=\"200\"/\u003e\n  \u003c/br\u003e\n  \u003ca href=\"https://pypi.org/project/fletmint/\"\u003e\u003cimg src=\"https://static.pepy.tech/badge/fletmint\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://badge.fury.io/py/fletmint\"\u003e\u003cimg src=\"https://badge.fury.io/py/fletmint.svg\" alt=\"PyPI version\" height=\"18\"\u003e\u003c/a\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eA sharp and modern components library for Flet.\u003cbr\u003eAccessible. Customizable. Open Source.\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#documentation\"\u003eDocumentation\u003c/a\u003e •\n  \u003ca href=\"#support\"\u003eSupport Me\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ckbd\u003e\n\u003cimg src=\"https://github.com/Bbalduzz/fletmint/assets/81587335/16351382-8148-4421-b9a3-599003caeda9\" alt=\"fletmint logo\"/\u003e\n\u003c/kbd\u003e\n++++\n\nlink:https://www.patreon.com/edoardobalducci[ image:https://pbs.twimg.com/media/DC4gjLRUMAAyQ92.jpg[Donate, align=\"center\", width=180]]\n\n= Installation\n- from link:https://pypi.org/project/fletmint/[PyPI]\n+\n```\npip install fletmint\n```\n- from source\n+\n```\ngit clone https://github.com/Bbalduzz/fletmint.git\n\n\ncd fletmint\n\npy311 setup.py install\n```\n\n= Documentation\n\nTIP: every component inherits its parent's class methods\n\n=== `fletmint.*Button*`\nThe `Button` component inherits the `flet.TextButton`\n\n===== params\n* `width`: int = width of the button\n* `height`:int = height of the button\n* `disabled`: bool = make the button disabled\n* `label`: str = button's label\n* `icon`: ft.icons = button's icon\n\n===== methods\n* `on_click` = fires when the button is clicked\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        ft.Row(\n            [\n                Button(),\n                Button(disabled=True),\n            ]\n        )\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/59810910-65bd-43d8-8980-f54c2508a881[alt=\"not bad.\",width=400]\n\n\n=== `fletmint.*TextInput*`\nThe `TextInput` component inherits the `flet.Container`\n\n===== params\n* `prefix`: Any\n* `suffix`: Any\n* `on_focus_additional`: Any = set a function to fire when the field is focused\n* `on_blur_additional`: Any = set a function to fire when the field is not focused\n* `theme`: ThemeMode\n\n===== methods\n* every in the TextButton\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        ft.Row(\n            [\n                TextInput(),\n                TextInput(password=True)\n            ]\n        )\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/6788bed5-f79a-45f1-b8fd-5259fdb1575c[alt=\"not bad.\",width=400]\n\nIt offers less style modifications, but *enhances* the `flet.TextField` accepting by default a `prefix` and a `suffix`:\n[source,python]\n-----------------\ntext_input_with_suffix_and_prefix = TextInput(\n    prefix=ft.Icon(name=ft.icons.SEARCH, color=ft.colors.GREY_200, size=18),\n    suffix=ft.CircleAvatar(\n        foreground_image_src=\"https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png\",\n        radius=30,\n    ),\n)\n\ndef show_password(e):\n    e.control.parent.parent.controls[0].password ^= True\n    e.control.parent.parent.controls[0].update()\n    e.control.icon = (\n        ft.icons.LOCK_OPEN_ROUNDED\n        if e.control.icon == ft.icons.LOCK_ROUNDED\n        else ft.icons.LOCK_ROUNDED\n    )\n    e.control.update()\npassword_input = TextInput(\n    password=True,\n    suffix=ft.IconButton(\n        icon=ft.icons.LOCK_ROUNDED,\n        icon_color=\"#e3e2e2\",\n        icon_size=10,\n        splash_radius=0,\n        on_click=show_password,\n    ),\n)\n-----------------\n\n=== `fletmint.*TagsInput*`\nThe `TagsInput` component inherits the `flet.Container`.\nThe tags are `fletmint.Badge`.\n\n===== params\n* `max_width`: int\n* `max_tags`: int\n* `theme`: ThemeMode\n\n===== methods\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        TagsInput(max_width=300, max_tags=2)\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/d1fd5130-aca5-4603-99e5-4588a3fd964b[alt=\"not bad.\",width=400]\n\n=== `fletmint.*Stepper*`\nThe `Stepper` component inherits the `flet.Container`.\n\n===== params\n* `initial_value`: int\n* `suffix`: str \n\n===== methods\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        Stepper(initial_value=123, suffix=\"px\")\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/e09c7410-1f68-4d55-a48b-c0e6f9288ea6[alt=\"not bad.\",height=150]\n\n\n=== `fletmint.*TabSwitch*`\nThe `TabSwitch` component inherits the `flet.Container`.\n\n===== params\n* `tab_labels`: list\n* `initial_value`: 0 | 1\n* `theme`: ThemeMode\n\n===== methods\n* `on_switch`: return the selected label\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        TabSwitch(\n            [\"Label\", \"Label\", \"Label\"],\n            on_switch=lambda value: print(f\"Switched to tab {value}\"),\n        )\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/b3a69719-8306-4525-bed8-ca9367800f6e[alt=\"not bad.\",height=150]\n\n\n=== `fletmint.*Dropdown*`\nThe `Dropdown` component inherits the `flet.Container`.\n\n===== params\n* `controls`: list = could be both plain strings or other flet components\n* `dropdown_icons`: list[ft.icons]\n* `max_width`: int\n* `theme`: ThemeMode\n\n\n===== methods\n* `on_select`: return the selected control\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        Dropdown(\n            max_width=250,\n            controls=[\n                \"figma\",\n                \"sketch\",\n                \"invision studio\",\n                \"framer\",\n                \"adobe xd\",\n            ],\n            on_select=lambda e: print(f\"Selected: {e}\"),\n        )\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/4fae1089-75e4-49cf-a575-f9d2f2e64d27[alt=\"not bad.\",height=300]\n\n=== `fletmint.*DatePicker*`\nThe `DatePicker` component inherits the `flet.UserControl`.\n\n===== params\n* `is_dropdown`: bool = if the calendar is dropdown (default `False`)\n* `left_content`: Any = set the left content of the calendars' footer\n* `multi_select_mode`: bool = if the user can select multiple dates (default `True`)\n* `dropdown_icons`: list[ft.icons]\n* `max_width`: int = set the width of the dropdown\n\n===== methods\n* `on_date_choosen`: return the selected date/dates as a `datetime` object. Here you can specify the date string formatting ex. `\"%Y-%m-%d\"`, `\"%d/%m/%Y\"` etc..\n* `on_cancel`: return nothing, if datepicker is in dropdown mode it closes it\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        DatePicker(\n            is_dropdown=False,\n            multi_select_mode=True,\n            on_date_choosen=lambda value: print(f\"Selected dates: {value}\"),\n        )\n    )\n\nft.app(target=main)\n-----------------\n|==================\n|`is_dropdown=False`|`is_dropdown=True`\n|image:https://github.com/Bbalduzz/fletmint/assets/81587335/ecafb7ad-e132-4ce3-8b5b-0759ee9ff0b6[alt=\"not bad.\",height=300]   | image:https://github.com/Bbalduzz/fletmint/assets/81587335/f0dfd7ea-16d1-4242-b230-2be9e03eea0e[alt=\"not bad.\",height=300]\n|==================\n\n=== `fletmint.*Badge*`\nThe `Badge` component inherits the `flet.Container`.\n\nThe component offers predefined colors: `BadgeColors`.\n\n* success: `BadgeColors.SUCCESS` (default)\n* warning: `BadgeColors.WARNING`\n* error: `BadgeColors.ERROR`\n\nor you can define custom colors in the `colors` param\n\n===== params\n* `colors`: dict | BadgeColors = the dict must be in the form: `{\"bgcolor\": \"#xxxxxx\", \"color\": \"#xxxxxx\"}`\n* `badge_text`: str = text inside the badge\n* `icon`: ft.icons = icon on the right of the text\n\n===== methods\n* `on_click`: fires when the badge is clicked (check the `TagsInput` code to see an example)\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        ft.Row([\n            Badge(\n                badge_text=\"Success\",\n                colors=BadgeColors.WARNING,\n                icon=ft.icons.CLOSE,\n                on_click=lambda e: print(\"cliked\"),\n            ),\n            Badge(\n                badge_text=\"Warning\",\n                colors=BadgeColors.SUCCESS,\n                icon=ft.icons.CLOSE,\n                on_click=lambda e: print(\"cliked\"),\n            ),\n            Badge(\n                badge_text=\"Error\",\n                colors=BadgeColors.ERROR,\n                icon=ft.icons.CLOSE,\n                on_click=lambda e: print(\"cliked\"),\n            )\n        ])\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/830ca341-717e-4ece-b155-ff5255dee48d[alt=\"not bad.\",width=400]\n\n\n=== `fletmint.*CheckBox*`\nThe `CheckBox` component inherits the `flet.Container`.\n\n===== params\n* `disabled`: bool = checkbox is disabled\n* `label`: str = text of the right of the checkbox \n* `checked`: bool = checkbox starts checked\n* `size`: int = checkbox size\n* `font_size`: int = set the label font size\n* `theme`: str | ThemeMode = programall set the theme\n\n===== methods\n* `on_click`: fires when the checkbox is clicked\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        ft.Column(\n            [\n                CheckBox(\n                    disabled=False, label=\"Label\", checked=False, on_click=lambda e: print(e)\n                ),\n                CheckBox(\n                    disabled=False, label=\"Label\", checked=True, on_click=lambda e: print(e)\n                ),\n                CheckBox(\n                    disabled=True, label=\"Label\", checked=False, on_click=lambda e: print(e)\n                ),\n            ]\n        )\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/0c785d26-5d26-443a-8545-9504d0c0c77a[alt=\"not bad.\",height=250]\n\n=== `fletmint.*Radio*`\nThe `Radio` component inherits the `flet.Radio`.\n\n===== params\n* `value`: str = value of the radio checkbox\n* `label`: str = text of the right of the radio \n\n===== methods\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        ft.RadioGroup(\n            content=ft.Column(\n                [\n                    Radio(\n                        value=\"red\",\n                        label=\"Label\",\n                    ),\n                    Radio(\n                        value=\"blue\",\n                        label=\"Label\",\n                    ),\n                    Radio(\n                        value=\"green\",\n                        label=\"Label\",\n                    ),\n                ]\n            )\n        )\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/d1406e2f-2802-4df6-b7e1-74c4e30bcb2e[alt=\"not bad.\",height=250]\n\n=== `fletmint.*ToggleSwitch*`\nThe `ToggleSwitch` component inherits the `flet.Container`.\n\n===== params\n\n===== methods\n* `on_switch`: fires when the switch is clicked\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        ToggleSwitch(on_switch=change_theme)\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/cb5f9053-e906-48f2-ae1d-e42c4fe6a9b5[alt=\"not bad.\",height=150]\n\n=== `fletmint.*Slider*`\nThe `Slider` component inherits the `flet.Slider`.\n\n===== params\n* `theme_mode`: page.theme_mode\n\n===== methods\n* `on_switch`: fires when the switch is clicked\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        Slider(theme_mode=page.theme_mode)\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/577be873-066a-40ba-9f4b-beafd996be40[alt=\"not bad.\",width=250]\n\n=== `fletmint.*Toggle*`\nThe `Slider` component inherits the `flet.Slider`.\n\n===== params\n* `label`: page.theme_mode\n* `value`: bool = default value\n* `theme`: ThemeMode\n\n===== methods\n* `on_change`: fires when the toggle is clicked\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        ft.Column(\n            [\n                Toggle(label=\"Light\", value=False, on_change=lambda e: print(e)),\n                Toggle(label=\"Dark\", on_change=lambda e: print(e)),\n            ]\n        )\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/d71fcec6-7a05-48c7-a0ca-df7176b7d49d[alt=\"not bad.\",width=250]\n\n=== `fletmint.*UserProfile*`\nThe `UserProfile` component inherits the `flet.Container`.\n\nThe component offers predefined profile statuses: `ProfileStatus`.\n\n* private: `ProfileStatus.PRIVATE` (default)\n* public: `ProfileStatus.OPEN`\n\n===== params\n* `username`: str = username shown in the profile\n* `avatar_foreground_img`: str = profile photo, local or url \n* `status`: ProfileStatus\n\n===== methods\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        UserProfile(\n            username=\"Edoardo B.\",\n            avatar_foreground_img=\"https://fiverr-res.cloudinary.com/image/upload/t_profile_original,q_auto,f_auto/v1/attachments/profile/photo/e6ee5c5f29487a42edba6bd2914fee74-1707225777335/002e6712-84fc-4d83-9b26-e5fd2f26739a.jpg\",\n            status=ProfileStatus.PRIVATE,\n        )\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/2accab4d-5faf-4952-9bde-72a5bf34bdb7[alt=\"not bad.\",width=250]\n\n=== `fletmint.*Carousel*`\nThe `Carousel` component inherits the `flet.UserControl`.\n\n===== params\n* `images_list`: list[tuple] = list of images with their descriptions\n* `animations`: list = animations, _IN_ and _OUT_\n* `compact`: bool = determine the type of the image carousel\n* `descriptive`: bool = show descriptions of the images\n* `transform_factor`: float = image carousel scale factor (to resize it)\n\n===== methods\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        Carousel(\n            images_list=[\n                (\n                    \"https://images.unsplash.com/photo-1714891203404-b25f32706e0a?q=80\u0026w=2370\u0026auto=format\u0026fit=crop\u0026ixlib=rb-4.0.3\u0026ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n                    \"image description 1\",\n                ),\n                (\n                    \"https://images.unsplash.com/photo-1714837291207-4985c06c9a60?q=80\u0026w=2371\u0026auto=format\u0026fit=crop\u0026ixlib=rb-4.0.3\u0026ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n                    \"image description 2\",\n                ),\n                (\n                    \"https://images.unsplash.com/photo-1715109429876-e00fbe6c4ae3?q=80\u0026w=2370\u0026auto=format\u0026fit=crop\u0026ixlib=rb-4.0.3\u0026ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n                    \"image description 3\",\n                ),\n                (\n                    \"https://plus.unsplash.com/premium_photo-1714115035000-023149febb01?q=80\u0026w=2370\u0026auto=format\u0026fit=crop\u0026ixlib=rb-4.0.3\u0026ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n                    \"image description 4\",\n                ),\n                (\n                    \"https://images.unsplash.com/photo-1714836992953-b8f7b4dc8afc?q=80\u0026w=2371\u0026auto=format\u0026fit=crop\u0026ixlib=rb-4.0.3\u0026ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n                    \"image description 5\",\n                ),\n            ],\n            animations=[ft.AnimationCurve.EASE_IN, ft.AnimationCurve.EASE_IN_OUT_CUBIC_EMPHASIZED],\n            compact=False,\n            descriptive=False,\n            transform_factor=0.5,\n        )\n    )\n\nft.app(target=main)\n-----------------\n|==================\n|`compact=False`|`is_dropdown=True`\n|image:https://github.com/Bbalduzz/fletmint/assets/81587335/9f533344-d638-4c0d-8cc4-599d876d14c9[alt=\"not bad.\",width=450]   | image:https://github.com/Bbalduzz/fletmint/assets/81587335/eb15e370-b8f0-40f3-b168-bfe0bd77b1fd[alt=\"not bad.\",width=400]\n|==================\n\n=== `fletmint.*AudioPlayer*`\nThe `AudioPlayer` component inherits the `flet.Container`.\n\n===== params\n* `url`: str = audio source\n\n===== methods\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        audio_player := AudioPlayer(\n            url=\"https://github.com/mdn/webaudio-examples/blob/main/audio-analyser/viper.mp3?raw=true\"\n        )\n    )\n    page.overlay.append(audio_player.audio)\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/554d94f6-1702-402c-9994-ea7bd8256a70[alt=\"not bad.\",width=450]\n\n\n=== `fletmint.*VideoPlayer*`\nThe `VideoPlayer` component inherits the `flet.Container`.\n\n===== params\n* `playlist`: list[ft.VideoMedia] = set `VideoPlayer` video sources\n* `player_title`: str = player title\n\n===== methods\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    page.bgcolor = \"#22242a\"\n\n    page.add(\n        VideoPlayer(\n            playlist=[\n                ft.VideoMedia(\n                    \"https://user-images.githubusercontent.com/28951144/229373720-14d69157-1a56-4a78-a2f4-d7a134d7c3e9.mp4\"\n                ),\n                ft.VideoMedia(\n                    \"https://user-images.githubusercontent.com/28951144/229373718-86ce5e1d-d195-45d5-baa6-ef94041d0b90.mp4\"\n                ),\n                ft.VideoMedia(\n                    \"https://user-images.githubusercontent.com/28951144/229373716-76da0a4e-225a-44e4-9ee7-3e9006dbc3e3.mp4\"\n                ),\n            ],\n            player_title=\"Demo video by Bbalduzz\",\n        )\n    )\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/d6dedf70-d79f-45a0-9141-b5f961f0ff4a[alt=\"not bad.\",width=450]\n\n\n=== `fletmint.*Code*`\nThe `Code` component inherits the `flet.UserControl`.\n\nThe component offers predefined code editor themes: `CodeTheme`. As of now it's supported:\n\n* *Ayu*: \n    - dark mode: `CodeTheme.AYU_DARK`\n    - light mode: `CodeTheme.AYU_LIGHT`\n* *Github*: \n    - dark mode: `CodeTheme.GITHUB_DARK` (default)\n* *One Dark Pro*: \n    - dark mode: `CodeTheme.ONE_DARK_PRO`\n\n===== params\n* `language`: str = set the code editor language's syntax rules\n* `code`: str = code to show\n* `font`: str = editor's font (_ttf_), can be online url, local path or page font\n* `theme`: CodeTheme = editor's theme\n* `read_only`: bool = enables edit mode (_default_: _False_)\n* `height`: int = editor's height\n\n===== methods\n\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\n\ndef main(page: ft.Page):\n    page.fonts = {\n        \"JetBrainsMono\": \"C:\\\\path\\\\to\\\\font\\\\JetBrainsMono-Regular.ttf\",\n        \"SourceCodePro\": \"/path/to/font/SourceCodePro.ttf\",\n    }\n    page.theme_mode = ft.ThemeMode.DARK\n    code_editor = Code(\n        # code=initial_code,\n        language=\"python\",\n        font=\"https://github.com/JetBrains/JetBrainsMono/raw/master/fonts/ttf/JetBrainsMono-Regular.ttf'\",\n        height=800,\n        theme=CodeTheme.ONE_DARK_PRO,\n        read_only=False,\n    )\n    page.add(code_editor)\n\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/a56a0ee0-f0c1-4d74-bb0a-baa1a5bbebe4[alt=\"not bad.\",width=450]\n\n=== `fletmint.*ColorPicker*`\nThe `Picker` component inherits the `flet.UserControl`.\n\n===== params\n* `color`: str = start color picker's color\n* `width`: int = color picker width\n* `height`: int = color picker height\n\n===== methods\n* `on_color_select`: def = fires when the color is selected\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\n\ndef main(page: ft.Page):\n    page.theme_mode = ft.ThemeMode.DARK\n    color_picker = ColorPicker(\n        color=\"#00ff00\", on_color_select=lambda value: print(\"selected color:\", value)\n    )\n    page.add(color_picker)\n\n\nft.app(target=main)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/56d27a74-0511-415c-a311-c769c5f96f90[alt=\"not bad.\",width=450]\n\n=== `fletmint.*Toaster*`\nThe component shows in the page's overlay the `fletmint.*Toast*`\n\n===== params\n* `page`: ft.Page = pass the flet page (_mandatory_)\n* `expand`: bool = decide if the toaster should be expanded by default\n* `position`: ToastPosition = set the toaster position\n    - `ToastPosition.TOP_LEFT`\n    - `ToastPosition.TOP_RIGHT`\n    - `ToastPosition.BOTTOM_LEFT`\n    - `ToastPosition.BOTTOM_RIGHT`\n\n===== methods\n* `show_toast`: \n    - `message`: str,\n    - `text`: str,\n    - `description`: str,\n    - `toast`: fletmint.Toast,\n    - `duration`: int,\n    - `toast_type`: fletmint.ToastType | str = check the fletmint.Toast documentation\n* `show_promise_toast`:\n    - `function`: def,\n    - `success_message`: str,\n    - `error_message`: str,\n    - `descriptive`: bool = this shows the function's output as the toast's desctiption\n* `remove_toast`:\n    - `toast`: fletmint.Toast,\n\n_example_: \n[source,python]\n-----------------\nimport flet as ft\nfrom fletmint import *\n\n\ndef main(page: ft.Page):\n    page.fonts = {\n        \"JetBrainsMono\": \"C:\\\\path\\\\to\\\\font\\\\JetBrainsMono-Regular.ttf\",\n        \"SourceCodePro\": \"/path/to/font/SourceCodePro.ttf\",\n    }\n    page.theme_mode = ft.ThemeMode.DARK\n    toast_manager = Toaster(page, expand=False, position=ToastPosition.TOP_RIGHT)\n\n    def show_action(e):\n        toast = Toast(\n            content=ft.Row(\n                [\n                    ft.Row(\n                        [\n                            ft.Text(\"This is an custom action\"),\n                        ]\n                    ),\n                    ft.TextButton(\n                        content=ft.Text(\n                            \"close\",\n                            style=ft.TextStyle(\n                                size=13,\n                                weight=ft.FontWeight.W_200,\n                            ),\n                        ),\n                        style=ft.ButtonStyle(\n                            shape=ft.ContinuousRectangleBorder(radius=8),\n                            color=ft.colors.WHITE,\n                            bgcolor=ft.colors.BLACK,\n                        ),\n                        on_click=lambda e: toast_manager.remove_toast(toast),\n                    ),\n                ],\n                alignment=ft.MainAxisAlignment.SPACE_BETWEEN,\n            )\n        )\n        toast_manager.show_toast(toast=toast)\n\n    def show_promise(e):\n        def long_running_task():\n            import time\n\n            time.sleep(5)  # long-running task\n            # raise Exception(\"Something went wrong\")\n            return \"long running task output\"\n\n        toast_manager.show_promise_toast(\n            long_running_task,\n            success_message=\"Task Completed Successfully\",\n            error_message=\"Task Failed\",\n            descriptive=True,  # shows the function's output as the toast's desctiption\n        )\n\n    toast_showcase = ft.Column([\n        SecondaryButton(\n            label=\"Action\",\n            on_click=show_action,\n        ),\n        SecondaryButton(\n            label=\"Info\",\n            on_click=lambda e: toast_manager.show_toast(\n                toast_type=ToastType.INFO,\n                text=\"This is a info message\",\n            ),\n        ),\n        SecondaryButton(\n            label=\"Success\",\n            on_click=lambda e: toast_manager.show_toast(\n                toast_type=ToastType.SUCCESS,\n                text=\"This is a success message\",\n            ),\n        ),\n        SecondaryButton(\n            label=\"Warning\",\n            on_click=lambda e: toast_manager.show_toast(\n                toast_type=ToastType.WARNING,\n                text=\"This is a warning message\",\n            ),\n        ),\n        SecondaryButton(\n            label=\"Error\",\n            on_click=lambda e: toast_manager.show_toast(\n                toast_type=ToastType.ERROR,\n                text=\"This is a error message\",\n            ),\n        ),\n        SecondaryButton(\n            label=\"Promise\",\n            on_click=show_promise,\n        ),\n        ft.TextButton(\n            content=ft.Text(\n                \"Remove latest toast\",\n                color=\"#e57373\",\n                size=13,\n                weight=ft.FontWeight.W_200,\n            ),\n            style=ft.ButtonStyle(\n                shape=ft.ContinuousRectangleBorder(radius=10),\n                side=ft.BorderSide(color=\"#5a3b3b\", width=1),\n                bgcolor=\"#2a1c1c\",\n                color={\n                    ft.MaterialState.HOVERED: \"#211717\",\n                    ft.MaterialState.FOCUSED: \"#211717\",\n                    ft.MaterialState.DEFAULT: \"#211717\",\n                },\n            ),\n            on_click=lambda e: toast_manager.remove_toast(\n                toast_manager.toasts[0]\n            ),\n        ),\n    ])\n    page.add(toast_showcase)\n\n\nft.app(target=main)\n-----------------\nhttps://github.com/Bbalduzz/fletmint/assets/81587335/ecc94756-1830-46ff-b15d-798d0669e50d[title=\"Toast\"]\n\n\n=== `fletmint.*Toast*`\nThe `Toast` component inherits the `flet.Container`.\n\n===== params\n* `content`: Any = the toast content, can be anything. If this is set you cannot set the text and description\n* `text`: str = the toast title\n* `description`: str = the toast description\n* `toast_type`: ToastType = the toast type. This defines colors and icons\n    - `ToastType.DEFAULT`\n    - `ToastType.INFO`\n    - `ToastType.SUCCESS`\n    - `ToastType.WARNING`\n    - `ToastType.ERROR`\n    - `ToastType.PROMISE`\n\n\n===== methods\n\u003e any method that may be defined in the content (see example)\n\n_example_: \n[source,python]\n-----------------\n# this creates a custom action toast\ntoast = Toast(\n    content=ft.Row(\n        [\n            ft.Row(\n                [\n                    ft.Text(\"This is an custom action\"),\n                ]\n            ),\n            ft.TextButton(\n                content=ft.Text(\n                    \"close\",\n                    style=ft.TextStyle(\n                        size=13,\n                        weight=ft.FontWeight.W_200,\n                    ),\n                ),\n                style=ft.ButtonStyle(\n                    shape=ft.ContinuousRectangleBorder(radius=8),\n                    color=ft.colors.WHITE,\n                    bgcolor=ft.colors.BLACK,\n                ),\n                on_click=lambda e: toast_manager.remove_toast(toast),\n            ),\n        ],\n        alignment=ft.MainAxisAlignment.SPACE_BETWEEN,\n    )\n)\n-----------------\nimage:https://github.com/Bbalduzz/fletmint/assets/81587335/b173b756-a336-4905-bcf4-4306e73d10bb[title=\"Toasts\",width=450]\n\n== Utils\n\n=== `fletmint.utils.*change_app_icon*`\nThis utility let the user chnage the app icon on runtime. \nThis utility works on `windows`, `macos`, `linux`, each os laverage its unique methods.\n\nNOTE: When building the app, use the `--icon` flag to set the icon in the build.\n\n===== params\n* `icon_path`: str | Path = path of your custom icon. This can be _png_, _jpeg_, _ico_, _bpm_, _icns_ (any)\n* `app_name`: Optional[str] = (macos only)\n* `app_path`: Optional[str] = (macos only)\n\n\n_example_: \n[source,python]\n-----------------\nimport os\nimport flet as ft\nfrom fletmint.utils import change_app_icon\n\nicon_path = os.path.join(\"icons\", \"my_custom_icon.png\")\n\ndef main(page: ft.Page):\n    page.window_width, page.window_height = 400, 400\n    page.title = \"Flet App with Custom Icon\"\n    page.vertical_alignment = ft.MainAxisAlignment.CENTER\n    page.horizontal_alignment = ft.CrossAxisAlignment.CENTER\n\n    page.add(\n        ft.Image(src=icon_path, width=64, height=64),\n        ft.Text(\"Hello, this is a Flet app with a custom icon!\"),\n    )\n\n\nchange_app_icon(icon_path=icon_path)\n\nft.app(target=main)\n-----------------\n|==================\n|`macos`|`windows` | `linux`\n|image:https://github.com/Bbalduzz/fletmint/assets/81587335/cced79a2-256c-405d-a8ce-55be728aecc9[alt=\"not bad.\",width=400]   | image:https://github.com/Bbalduzz/fletmint/assets/81587335/fee9d862-1338-4543-b224-515f008b43b7[alt=\"not bad.\",height=300]   | not tested\n|==================\n\n\n= Support\n_Maintaining_ and _updating_ this kit, along with _adding new components_, is a *time-consuming* and often *challenging* process. However, I believe it's important to make this resource available to everyone because it's the right thing to do. If you find value in this components library and would like to *_support its development_*, please consider contributing in any way you can.\n\nThank you for your support, even if it's just leaving a star on the project! Your encouragement means a lot.\n\nlink:https://www.patreon.com/edoardobalducci[ image:https://pbs.twimg.com/media/DC4gjLRUMAAyQ92.jpg[Donate, align=\"center\", width=180]]\n\nlink:https://liberapay.com/balduzz/donate[image:https://liberapay.com/assets/widgets/donate.svg[Donate, align=\"center\"]]\n\nlink:https://www.paypal.com/donate/?hosted_button_id=3C8G7V8DUWLQG[image:https://cwc-berkeley.org/wp-content/uploads/2017/11/btn-donation-paypal-2x-167.png[PayPal, align=\"center\", width=150]]\n\nlink:https://ko-fi.com/C0C8T2OJ6[image:https://ko-fi.com/img/githubbutton_sm.svg[Ko-fi, align=\"center\"]]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbalduzz%2Ffletmint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbalduzz%2Ffletmint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbalduzz%2Ffletmint/lists"}