File: autofocus.md | Updated: 11/15/2025
AutoFocus manages focus on focusable element on load.
import { AutoFocusModule } from 'primeng/autofocus';
AutoFocus is applied to any focusable input element with the pAutoFocus directive.
<input type="text" pInputText [pAutoFocus]="true" placeholder="Automatically focused" />
Import
Basic


Templates
Highly customizable application templates to get started in no time with style. Designed and implemented by PrimeTek.
PrimeNG 20.3.0 by PrimeTek