Skip to content

Focus monitor

@xngui/cdk/focus-monitor
@xngui/cdk/focus-monitor

Keyboard vs pointer focus origin tracking.

Preview

Last focus origin

Origin

Tab to a button for keyboard origin, or click for mouse / touch.

import { XFocusMonitored } from '@xngui/cdk/focus-monitor';
 
<x-button xFocusMonitored (xFocused)="onFocused($event)" (xBlurred)="onBlurred()">
Primary
<x-button>
<x-button appearance="outline" xFocusMonitored (xFocused)="onFocused($event)" (xBlurred)="onBlurred()">
Secondary
<x-button>

Events

Interact with the preview — events will appear here.