NavigationBar
Material 3 Navigation Bar component.
Navigation bars offer a persistent and convenient way to switch between primary destinations in an app.
ft.NavigationBar(
destinations=[
ft.NavigationBarDestination(icon=ft.Icons.CIRCLE, label="Item 1"),
ft.NavigationBarDestination(icon=ft.Icons.SQUARE, label="Item 2"),
ft.NavigationBarDestination(icon=ft.Icons.HEXAGON, label="Item 3"),
],
)

Inherits: LayoutControl, AdaptiveControl
Properties
animation_duration- The transition time for each destination as it goes between selected and unselected.bgcolor- The color of the navigation bar itself.border- TBDdestinations- Defines the appearance of the button items that are arrayed within the navigation bar.elevation- The elevation of the navigation bar itself.indicator_color- The color of the selected destination indicator.indicator_shape- The shape of the selected destination indicator.label_behavior- Defines how the destinations' labels will be laid out and when they'll be displayed.label_padding- The padding around the flet.NavigationBarDestination.label.overlay_color- The highlight color of theNavigationBarDestinationin various ControlState states.selected_index- The index intodestinationsfor the current selectedNavigationBarDestinationorNoneif no destination is selected.shadow_color- The color used for the drop shadow to indicateelevation.
Events
on_change- Called when selected destination changed.
Examples
Basic Example
import flet as ft
def main(page: ft.Page):
page.title = "NavigationBar Example"
page.navigation_bar = ft.NavigationBar(
destinations=[
ft.NavigationBarDestination(icon=ft.Icons.EXPLORE, label="Explore"),
ft.NavigationBarDestination(icon=ft.Icons.COMMUTE, label="Commute"),
ft.NavigationBarDestination(
icon=ft.Icons.BOOKMARK_BORDER,
selected_icon=ft.Icons.BOOKMARK,
label="Favorites",
),
]
)
page.add(
ft.SafeArea(
content=ft.Text("Body!"),
)
)
if __name__ == "__main__":
ft.run(main)

Properties
animation_durationclass-attributeinstance-attribute
animation_duration: Optional[DurationValue] = NoneThe transition time for each destination as it goes between selected and unselected.
bgcolorclass-attributeinstance-attribute
bgcolor: Optional[ColorValue] = NoneThe color of the navigation bar itself.
destinationsclass-attributeinstance-attribute
destinations: Annotated[list[NavigationBarDestination], V.visible_controls(min_count=2)] = field(default_factory=list)Defines the appearance of the button items that are arrayed within the navigation bar.
Raises:
- ValueError - If it does not contain at least two visible destinations.
elevationclass-attributeinstance-attribute
elevation: Optional[Number] = NoneThe elevation of the navigation bar itself.
indicator_colorclass-attributeinstance-attribute
indicator_color: Optional[ColorValue] = NoneThe color of the selected destination indicator.
indicator_shapeclass-attributeinstance-attribute
indicator_shape: Optional[OutlinedBorder] = NoneThe shape of the selected destination indicator.
label_behaviorclass-attributeinstance-attribute
label_behavior: Optional[NavigationBarLabelBehavior] = NoneDefines how the destinations' labels will be laid out and when they'll be displayed.
Can be used to show all labels, show only the selected label, or hide all labels.
Defaults to NavigationBarLabelBehavior.ALWAYS_SHOW.
label_paddingclass-attributeinstance-attribute
label_padding: Optional[PaddingValue] = NoneThe padding around the flet.NavigationBarDestination.label.
overlay_colorclass-attributeinstance-attribute
overlay_color: Optional[ControlStateValue[ColorValue]] = NoneThe highlight color of the NavigationBarDestination in various ControlState states.
The following ControlState
values are supported: PRESSED, HOVERED and FOCUSED.
selected_indexclass-attributeinstance-attribute
selected_index: int = 0The index into destinations for the current selected NavigationBarDestination or None if no destination is selected.
shadow_colorclass-attributeinstance-attribute
shadow_color: Optional[ColorValue] = NoneThe color used for the drop shadow to indicate elevation.
Events
on_changeclass-attributeinstance-attribute
on_change: Optional[ControlEventHandler[NavigationBar]] = NoneCalled when selected destination changed.