KeyFilter

KeyFilter is a directive to restrict individual key strokes. In order to restrict the whole input, use InputNumber or InputMask instead.

KeyFilter provides various presets configured with the pKeyFilter property.

KeyFilter provides various presets configured with the pKeyFilter property.

presets-demo

In addition to the presets, a regular expression can be configured for customization.

regex-demo

Refer to InputText for accessibility as KeyFilter is a built-in add-on of the InputText.

ON THIS PAGE
PrimeBlocks
490+ ready to use UI blocks crafted with PrimeNG and Tailwind CSS.
Learn More