Field Number

The fields number components are used for collecting user provided number information.

Error

You can use this bool to manually set the field in State 'error'.

The Field need to receive a cascaded EditContext. The Error and ValidationMessage will be manage automatically by the EditContext.

TypeDefault Value
boolfalse
An error occur.
This is a hint
<NVFieldNumber Error Margin=". . 3"/>  
<NVFieldNumber  
  Error 
  Message="This is a hint" 
  Validation="An error occur."
/>

Label

Label define the label value of the Text Field.

TypeDefault Value
stringnull
<NVFieldNumber Name="labelSample" Label="This is a label"/>

Max

Define the maximum value for the number.

TypeDefault Value
TValuenull
<NVFieldNumber Max=@(10)/>

Message

Message define a 'hint ' message for the Text Field.

TypeDefault Value
stringnull
This is a message
<NVFieldNumber Message="This is a message"/>

Min

Define the minimum value for the number.

TypeDefault Value
TValuenull
This is a message
<NVFieldNumber Min=@(0) Message="This is a message"/>

Name

Name define the unique name for a field.
It will add name and id attributes of the input. If there is a label will also add the for attribute to the label.

When for is provided to a label element and when an id is provided to the input element (with the same value), the label click will focus the input.

If an EditContext is provided by the EditForm, the FieldIdentifier.FieldName will be used.

If you don't pass a this parameter, an autoName will be generated and used within attributes of input and label.

TypeDefault Value
stringnull
<NVFieldNumber Name="uniqueName" Label="This is a label"/>

NVFieldAfter

Add content after the 'input' element.

TypeDefault Value
RenderFragmentnull
<NVFieldNumber Name="FieldAfter" Label="FieldAfter">
  <NVFieldAfter>
    <NVIcon Name="search"/>
  </NVFieldAfter>
</NVFieldNumber>

NVFieldBefore

Add content before the 'input' element.

TypeDefault Value
RenderFragmentnull
<NVFieldNumber Name="FieldBefore" Label="FieldBefore">
  <NVFieldBefore>
    <NVIcon Name="search"/>
  </NVFieldBefore>
</NVFieldNumber>

NVFieldLabel

FieldLabel define the label's content of the Text Field.

TypeDefault Value
RenderFragmentnull
<NVFieldNumber Name="FieldLabel">
  <NVFieldLabel>
    This is a <NVBlock Tag="strong" TextColor="red-500">label</NVBlock>
  </NVFieldLabel>
</NVFieldNumber>

NVFieldMessage

When you need a more complex (with html markups) message, you can use FieldMessage RenderFragment.

TypeDefault Value
RenderFragmentnull
This is a message with markups
<NVFieldNumber>
  <NVFIeldMessage>This is a message with <strong>markups</strong></NVFIeldMessage>
</NVFieldNumber>

NVFieldValidation

When you need a more complex (with html markups) Validation message, you can use FieldValidation RenderFragment.
It will override the Validation message, coming from Model/EditContext or from Validation Parameter.

TypeDefault Value
RenderFragmentnull
An error occurred.
<NVFieldNumber Error>
  <NVFieldValidation>An error <strong>occurred</strong>.</NVFieldValidation>
</NVFieldNumber>

Placeholder

Placeholder define the placeholder value of the Text Field.

TypeDefault Value
stringnull
<NVFieldNumber Placeholder="This is a placeholder"/>

Readonly

Set the Field input as readonly.

TypeDefault Value
boolfalse
<NVFieldNumber Readonly />

Required

Set the Field as required. This adds an * after the label.

TypeDefault Value
boolfalse
<NVFieldnumber Name="Required" Label="Required" Required />

Step

Define the step value.

TypeDefault Value
TValuenull
<NVFieldNumber Step=@(0.1) />

Success

Set the field in State 'success'.

TypeDefault Value
boolfalse
Well done !
This is a hint
<NVFieldNumber Success Margin=". . 3"/>
<NVFieldNumber  
  Success 
  Message="This is a hint" 
  Validation="Well done !"
/>