Skip to content

feat: add scrollable and pinned leading/trailing support to NavigationRail#6356

Open
ndonkoHenri wants to merge 11 commits intorelease/v0.85.0from
improve-nav-rail
Open

feat: add scrollable and pinned leading/trailing support to NavigationRail#6356
ndonkoHenri wants to merge 11 commits intorelease/v0.85.0from
improve-nav-rail

Conversation

@ndonkoHenri
Copy link
Copy Markdown
Contributor

@ndonkoHenri ndonkoHenri commented Mar 30, 2026

Fix #1923

Test code

import flet as ft


def main(page: ft.Page):
    page.add(
        ft.NavigationRail(
            height=280,
            width=140,
            selected_index=0,
            label_type=ft.NavigationRailLabelType.ALL,
            min_width=100,
            min_extended_width=180,
            scrollable=True,
            pin_leading_to_top=True,
            pin_trailing_to_bottom=True,
            leading=ft.IconButton(icon=ft.Icons.MENU, tooltip="Leading"),
            trailing=ft.IconButton(icon=ft.Icons.SETTINGS, tooltip="Trailing"),
            destinations=[
                ft.NavigationRailDestination(
                    icon=ft.Icons.LOOKS_ONE,
                    label="One",
                ),
                ft.NavigationRailDestination(
                    icon=ft.Icons.LOOKS_TWO,
                    label="Two",
                ),
                ft.NavigationRailDestination(
                    icon=ft.Icons.LOOKS_3,
                    label="Three",
                ),
                ft.NavigationRailDestination(
                    icon=ft.Icons.LOOKS_4,
                    label="Four",
                ),
                ft.NavigationRailDestination(
                    icon=ft.Icons.LOOKS_5,
                    label="Five",
                ),
                ft.NavigationRailDestination(
                    icon=ft.Icons.LOOKS_6,
                    label="Six",
                ),
            ],
        )
    )


ft.run(main)

Summary by Sourcery

Add configurability for scrollable navigation rail content and pinned leading/trailing controls, and cover the new behavior with an integration test.

New Features:

  • Introduce pin_leading_to_top, pin_trailing_to_bottom, and scrollable properties on NavigationRail to control layout and scrolling behavior of leading, trailing, and destination items.

Enhancements:

  • Document the new NavigationRail properties and provide an example usage in the Python API docstring.
  • Wire new NavigationRail properties through the Flutter control to the underlying widget for runtime configuration.

Tests:

  • Add an integration screenshot test validating scrollable NavigationRail with pinned leading and trailing controls.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 30, 2026

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: e0fa5c9
Status: ✅  Deploy successful!
Preview URL: https://3a3c668f.flet-docs.pages.dev
Branch Preview URL: https://improve-nav-rail.flet-docs.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 30, 2026

Deploying flet-examples with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7f48fef
Status: ✅  Deploy successful!
Preview URL: https://d7390718.flet-examples.pages.dev
Branch Preview URL: https://improve-nav-rail.flet-examples.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 30, 2026

Deploying flet-website-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7f48fef
Status: ✅  Deploy successful!
Preview URL: https://2db8c8e2.flet-website-v2.pages.dev
Branch Preview URL: https://improve-nav-rail.flet-website-v2.pages.dev

View logs

@FeodorFitsner FeodorFitsner modified the milestones: 0.84.0, 0.85.0 Mar 30, 2026
Rename .codex/skills/* to .agents/skills/* to relocate skill definitions without content changes (100% similarity). Add AGENTS.md documenting that skills live in `.agents/skills`, and add CLAUDE.md as a symlink to AGENTS.md.
Replace bracketed inline references with Sphinx-style :attr:`...` cross-references in sdk/python/.../navigation_rail.py docstrings. This clarifies attribute links for documentation tooling (e.g. selected_icon, leading, trailing, destinations, pin_leading_to_top, pin_trailing_to_bottom) and improves rendering in generated docs. Only docstring text was changed.
Pages like controls/navigationrail/index.md were generating xref
URLs ending in /index (e.g. /docs/controls/navigationrail/index)
instead of the clean /docs/controls/navigationrail that Docusaurus
actually serves. Strip the /index suffix when building page routes.
@FeodorFitsner FeodorFitsner changed the base branch from main to release/v0.85.0 April 5, 2026 19:09
Record the new scrollable, pin_leading_to_top, and pin_trailing_to_bottom
properties under 0.85.0 New features, crediting @ndonkoHenri and linking
to #1923 and #6356.
Add two golden images for macOS tooltip integration tests: tooltip_shows_on_hover.png and tooltip_custom_properties_on_hover.png under sdk/python/packages/flet/integration_tests/controls/core/golden/macos/control. These images are used to validate tooltip rendering/appearance on hover.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scrollable NavigationRail

2 participants