@@ -46,9 +46,10 @@ provides a tab-like UI for navigating between routes.
46
46
"file": "tab-nav-bar-basic-example.html",
47
47
"region": "mat-tab-nav"}) -->
48
48
49
- The ` tab-nav-bar ` is not tied to any particular router; it works with normal ` <a> ` elements and uses
50
- the ` active ` property to determine which tab is currently active. The corresponding
51
- ` <router-outlet> ` can be placed anywhere in the view.
49
+ The ` mat-tab-nav-bar ` is not tied to any particular router; it works with normal ` <a> ` elements and
50
+ uses the ` active ` property to determine which tab is currently active. The corresponding
51
+ ` <router-outlet> ` must be wrapped in an ` <mat-tab-nav-panel> ` component and should typically be
52
+ placed relatively close to the ` mat-tab-nav-bar ` (see [ Accessibility] ( #accessibility ) ).
52
53
53
54
### Lazy Loading
54
55
By default, the tab contents are eagerly loaded. Eagerly loaded tabs
@@ -85,23 +86,14 @@ duration can be configured globally using the `MAT_TABS_CONFIG` injection token.
85
86
"region": "slow-animation-duration"}) -->
86
87
87
88
### Accessibility
88
- ` MatTabGroup ` and ` MatTabNavBar ` implement different interaction patterns for different use-cases.
89
- You should choose the component that works best for your application.
90
-
91
- ` MatTabGroup ` combines ` tablist ` , ` tab ` , and ` tabpanel ` into a single component with
92
- handling for keyboard inputs and focus management. You should use this component for switching
93
- between content within a single page.
94
-
95
- ` MatTabNavBar ` , implements a navigation interaction pattern by using a ` <nav> ` element with anchor
96
- elements as the "tabs". You should use this component when you want your cross-page navigation to
97
- look like a tabbed interface. As a rule of thumb, you should consider ` MatTabNavBar ` if changing
98
- tabs would change the browser URL. For all navigation, including with ` MatTabNavBar ` , always move
99
- browser focus to an element at the beginning of the content to which the user is navigating.
100
- Furthermore, consider placing your ` <router-outlet> ` inside of a
101
- [ landmark region] ( https://www.w3.org/TR/wai-aria-1.1/#dfn-landmark ) appropriate to the page.
102
-
103
- Avoid mixing both ` MatTabGroup ` and ` MatTabNavBar ` in your application. The inconsistent interaction
104
- patterns applied between the components may confuse users.
89
+ ` MatTabGroup ` and ` MatTabNavBar ` both implement the
90
+ [ ARIA Tabs design pattern] ( https://www.w3.org/TR/wai-aria-practices-1.1/#tabpanel ) . Both components
91
+ compose ` tablist ` , ` tab ` , and ` tabpanel ` elements with handling for keyboard inputs and focus
92
+ management.
93
+
94
+ When using ` MatTabNavBar ` , you should place the ` <mat-tab-nav-panel> ` component relatively close to
95
+ if not immediately adjacent to the ` <nav mat-tab-nav-bar> ` component so that it's easy for screen
96
+ reader users to identify the association.
105
97
106
98
#### Labels
107
99
0 commit comments