Styling ft.Tabs #3588
Styling ft.Tabs
#3588
-
QuestionIs it possible to style tab title with custom styles like font size, font type ? Code sampleNo response Error messageNo response ------------------------------------------------------
|
Beta Was this translation helpful? Give feedback.
Answered by
burhansvural
Jul 2, 2024
Replies: 1 comment
-
@kspviswa import flet as ft
def main(page: ft.Page):
page.fonts = {
"font1": "fonts/DancingScript-Regular.ttf"
}
t = ft.Tabs(
selected_index=1,
animation_duration=300,
tabs=[
ft.Tab(
content=ft.Container(
content=ft.Text(
value="This is Tab 1",
),
alignment=ft.alignment.center,
),
tab_content=ft.Text("Tab 1", font_family="font1", italic=True)
),
ft.Tab(
tab_content=ft.Icon(ft.icons.SEARCH),
content=ft.Text("This is Tab 2"),
),
ft.Tab(
text="Tab 3",
icon=ft.icons.SETTINGS,
content=ft.Text("This is Tab 3"),
),
],
expand=1,
)
page.add(
t
)
ft.app(target=main, assets_dir="assets") |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kspviswa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@kspviswa
Yes, this is possible