Save $100 with our Black Friday deals!

Get $100 OFF with promo code BLACKFRIDAY2024 at checkout until November 30.

See Pricing

Still using Radzen Studio?
Achieve more with Radzen Blazor Studio

Radzen Blazor Studio is our new flagship product and vision of how rapid Blazor application development should be done.

Go to Radzen Blazor Studio

Mask (Blazor)

This article demonstrates how to use the Mask component. Check also the component guide and API reference.

Mask Properties

Name Type Default Description
Name string ‘mask’ + index suffix Unique name of the Mask.
Value string/expression null Mask value.
Placeholder string empty Mask placeholder.
Mask string null Mask pattern.
Pattern string null Pattern used to validate the input.
Maxlength integer null Maximum number of character allows in the input field.
ReadOnly boolean/expression false Is Mask read-only.
Disabled boolean/expression false Is Mask disabled.
Visible boolean/expression true Is Mask visible.

For more info about expressions please visit expressions in our documentation.

Mask Events

Name Type Default Description
Change event null Change event of the Mask. New value as event argument.
MouseEnter event null MouseEnter event of the Mask.
MouseLeave event null MouseLeave event of the Mask.
ContextMenu event null ContextMenu event of the Mask.

For more info about event actions please visit event actions in our documentation.

Blazor declaration

<RadzenMask Mask="(***) ***-****" Pattern="[^0-9]" Placeholder="(000) 000-0000" Name="Phone" @bind-Value="obj.Phone" />

Restricting only letters and only numbers at specific position is not supported.