Skip to content

Commit 804f925

Browse files
amcdnlmmalerba
authored andcommitted
docs(focus): Add docs for regions #8082 (#8128)
* docs(focus): Add docs for regions #8082 * docs(a11y): add more desc for focus trap
1 parent e703b3e commit 804f925

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/cdk/a11y/a11y.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ This directive is declared in `A11yModule`.
6868
This directive will not prevent focus from moving out of the trapped region due to mouse
6969
interaction.
7070

71+
#### Regions
72+
Regions can be declared explicitly with an initial focus element by using
73+
the `cdkFocusRegionStart`, `cdkFocusRegionEnd` and `cdkFocusInitial` DOM attributes.
74+
`cdkFocusInitial` specifies the element that will receive focus upon initialization of the region.
75+
`cdkFocusRegionStart` and `cdkFocusRegionEnd` define the region within which focus will be
76+
trapped. When using the tab key, focus will move through this region and wrap around on either end.
77+
78+
For example:
79+
80+
```html
81+
<a mat-list-item routerLink cdkFocusRegionStart>Focus region start</a>
82+
<a mat-list-item routerLink>Link</a>
83+
<a mat-list-item routerLink cdkFocusInitial>Initially focused</a>
84+
<a mat-list-item routerLink cdkFocusRegionEnd>Focus region end</a>
85+
```
86+
7187

7288
### InteractivityChecker
7389
`InteractivityChecker` is used to check the interactivity of an element, capturing disabled,

0 commit comments

Comments
 (0)