Field Text

The fields text components are used for collecting user provided information. They typically reside in forms but can appear in other places, like dialog boxes and search.

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
<NVFieldText Error Margin=". . 3"/>  
<NVFieldText  
  Error 
  Message="This is a hint" 
  Validation="An error occur."
/>

Label

Label define the label value of the Text Field.

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

Message

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

TypeDefault Value
stringnull
This is a message
<NVFieldText 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
<NVFieldText Name="uniqueName" Label="This is a label"/>

NVFieldAfter

Add content after the 'input' element.

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

NVFieldBefore

Add content before the 'input' element.

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

NVFieldLabel

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

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

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
<NVFieldText>
  <NVFieldMessage>This is a message with <strong>markups</strong></NVFieldMessage>
</NVFieldText>

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
This is a validation message
<NVFieldText 
  Error 
>
  <NVFieldValidation>This is a <strong>validation</strong> message</NVFieldValidation>
</NVFieldText>

Placeholder

Placeholder define the placeholder value of the Text Field.

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

Readonly

Set the Field input as readonly.

TypeDefault Value
boolfalse
<NVFieldText Readonly />

Required

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

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

Success

Set the field in State 'success'.

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