Skip to content

docs: show how to use Tabs to navigate between views - #6257

Draft
totally-not-ai[bot] wants to merge 1 commit into
mainfrom
docs/tabs-route-navigation
Draft

totally-not-ai[bot] wants to merge 1 commit into
mainfrom
docs/tabs-route-navigation

Conversation

@totally-not-ai

@totally-not-ai totally-not-ai Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Review risk: two-way door: adds one Flow-only section and three example classes to the Tabs page. Nothing existing changes.

Summary

Adds a Navigating Between Views (Flow) section to the Common Cases of articles/components/tabs/index.adoc. The docs already mention Tabs for navigation (the Tabs page and the Building Apps "compose" guide), but no page shows how to link tabs to routes and keep the selected tab in sync with the view being shown.

What changed

  • The new section covers:
    • Putting the tabs in a router layout, with a RouterLink in each tab, so the tabs are real links that can be opened in a new browser tab or bookmarked.
    • Selecting the matching tab in afterNavigation(), so the selection also follows the back button and direct links.
    • Turning off autoselect, so no tab is selected when the current view has no tab.
    • A pointer to Side Navigation for the main navigation of an application.
  • New compiled examples SettingsLayout, ProfileView and NotificationsView in com.vaadin.demo.component.tabs.routes.

This replaces the "Bind tabs to routes" recipe from the retired Vaadin Cookbook.

Test summary

  • The new examples compile and pass the Spotless format check (mvn spotless:check compile).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment

This PR has been deployed for preview.

URL: https://docs-preview-pr-6257.fly.dev

Changed pages

Added content is highlighted in green; removed content is marked in red on each page.

Other changed files

  • src/main/java/com/vaadin/demo/component/tabs/routes/NotificationsView.java (added)

Built from 3b792ca

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.

0 participants