RayCraftDocs
v1.0.3 raycraft.dev
On this page

MaskedInput

Free

Text field that formats what you type by a mask: 0 is a digit, a is a letter, * is a letter or digit, any other character is a fixed separator (escape a mask character with a backslash). The fixed part is added for you (typing it yourself is also accepted). The value is only accepted when the mask is complete. Preset gives ready masks with checks (Date, Time, CreditCard with the Luhn check), and Pattern adds a regular expression that the finished value must match.

Example

MaskedInput control

Parameters

ParameterTypeDescription
ClassstringExtra CSS classes added to the root element.
DisabledboolDisables interaction.
DisplayNamestringName used in validation messages.
HelperTextstringHint shown below the field.
LabelstringVisible label text (charts: accessible name; IconButton: accessible name and tooltip).
MaskstringPattern: 0 digit, a letter, * letter or digit, other characters are literals.
PatternstringRegular expression the finished value must match.
PatternMessagestringError text when Pattern does not match.
PlaceholderstringPlaceholder shown when the field is empty.
PresetMaskPresetReady-made mask with validation: Date, Time or CreditCard. Mask overrides it.
ReadOnlyboolShows the value but does not allow changes.
ReturnRawboolBinds the typed characters without the separators.
StylestringInline style added to the root element.
ValuestringCurrent value. Use with @bind-Value.

Events

EventTypeDescription
ValueChangedEventCallback<string>Raised when the value changes.

Package

MaskedInput is part of RayCraft Free. Package: RayCraft.Blazor. It comes from nuget.org. See Getting started.