📄 primeng/autofocus

File: autofocus.md | Updated: 11/15/2025

Source: https://primeng.org/autofocus

  • Primary

    Surface

    PresetsAuraMaterialLaraNora

    Ripple

    RTL

  • v20

  • FEATURES

  • API

AutoFocus

AutoFocus manages focus on focusable element on load.

Import #

import { AutoFocusModule } from 'primeng/autofocus';

Basic #

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