Using the Angular CDK Trap Focus directive

Brian Treese on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateAccessibility4 min

About this video

Explains what a focus trap is and why it matters for accessibility in web applications, then shows how to add the Angular CDK trap focus directive to a component. Aimed at developers building Angular interfaces.

What you’ll learn

  • Explain what a focus trap is and why it matters for accessibility
  • Add the Angular CDK cdkTrapFocus directive to keep focus inside a component
  • Provide initial focus with the cdkTrapFocusAutoCapture input