Skip to content

Keyboard Navigation

Keyboard users should be able to interact with UI.

TypeScript

import { Component } from "@angular/core";
@Component({
selector: "app-keyboard",
standalone: true,
templateUrl: "./keyboard.component.html",
})
export class KeyboardComponent {
submit() {
console.log("Submitted");
}
}

HTML

<button (click)="submit()" (keydown.enter)="submit()">Submit</button>