BaseComponent

The NVBaseComponent class is the Base class inherited by almost every components of Elia Design.

AddClass

Add a class to the component.
Parameter NameType
classNamestring
Return type

void

Code

AddClass(DomClass.TextColor("orange-500"))

AddStyle

Add a style to the component.
Parameter NameType
stylestring
Return type

void

Code

AddStyle(DomStyle.TextColor("#F00"))

Attributes

Generate attributes Dictionary based on passed Parameters.
Parameter NameType
componentstring
avoidClassesstring[]
avoidStylesstring[]
avoidAttributesstring[]
Return type

Dictionary<string, object>

Code

@inherits Nova.Components.NVBaseComponent;

<div @attributes=@Attributes(_componentClass, new string [] {"Color"})>
...
</div>

@code {
  private string _componentClass = "my-new-component";
  
  [Parameter]
  public bool Small { get; set; }
  
  [Parameter]
  public bool Loading { get; set; }

  public override async Task SetParametersAsync(ParameterView parameters) {
    await base.SetParametersAsync(parameters);
    
    // Loading Parameter

    AddClass(DomClass.Loading(Loading, _componentClass));
    
    // Small Parameter
 
    AddClass(DomClass.Small(Small, _componentClass));
    
    // Manage Color Parameter
    
    string[] colorTint = ColorUtils.GetColorTint(Color?.ToLower() ?? "orange-500");
    
    if (String.IsNullOrEmpty(TextColor)) {
      AddClass(DomClass.TextColor(colorTint[0], 600)); // always the darkest (600) for text color
    }
    
    if (String.IsNullOrEmpty(BackgroundColor)) {
      AddClass(DomClass.BackgroundColor(colorTint[0], 100)); // always the lightest (100) for background
    }
    
      
  }
}

Result

<div class="my-new-component ...classFromParameters" style="...styleFromParameters" ...attrFromParameters ></div>

ActiveEffect

Add the effect class when the element has an :active pseudo class.

TypeDefault Value
stringnull

Code

<NVButton ActiveEffect="@ActiveEffect.UP"> </NVButton>

Result

<button class="nv-btn effect-up"></button>

Alt

Add the attribute alt to img element.

TypeDefault Value
stringnull

Code

<NVBlock Tag="img" Alt="Alternate text"></NVBlock>

Result

<img alt="Alternate text" />

BackgroundColor

Set the Background Color to the element.

TypeDefault Value
stringnull

Code

<NVBlock BackgroundColor="orange-500"></NVBlock>

Result

<div class="bg-orange-500"></div>

Code

<NVBlock BackgroundColor="#FF0000"></NVBlock>

Result

<div style="background-color:#FF0000;"></div>

ActiveBackgroundColor

Set the Background Color to the element when active.

TypeDefault Value
stringnull

Code

<NVButton ActiveBackgroundColor="orange-500"> </NVButton>

Result

<div class="nv-btn active:bg-orange-500"></div>

HoverBackgroundColor

Set the Background Color to the element when hovered.

TypeDefault Value
stringnull

Code

<NVBlock HoverBackgroundColor="orange-500"></NVBlock>

Result

<div class="hover:bg-orange-500"></div>

BorderColor

Set the border color to the element.

TypeDefault Value
stringnull

Code

<NVBlock BorderColor="orange-500"></NVBlock>

Result

<div class="border-orange-500"></div>

Code

<NVButton BorderColor="#FF0000"> </NVButton>

Result

<div style="border-color:#FF0000;"></div>

ActiveBorderColor

Set the border color to the element when active.

TypeDefault Value
stringnull

Code

<NVBlock ActiveBorderColor="orange-500"></NVBlock>

Result

<div class="active:border-orange-500"></div>

HoverBorderColor

Set the border color to the element when hovered.

TypeDefault Value
stringnull

Code

<NVBlock HoverBorderColor="orange-500"></NVBlock>

Result

<div class="hover:border-orange-500"></div>

BorderRadius

Set border radius of an element.

TypeDefault Value
stringnull

Code

<NVBlock BorderRadius="sm"></NVBlock>

Result

<div class="rounded-sm"></div>

Code

<NVBlock BorderRadius="t-sm"></NVBlock>

Result

<div class="rounded-t-sm"></div>

Code

<NVBlock BorderRadius="tl-sm br-sm"></NVBlock>

Result

<div class="rounded-tl-sm rounded-br-sm"></div>

Code

<NVBlock BorderRadius="base"></NVBlock>

Result

<div class="rounded"></div>

Code

<NVBlock BorderRadius="2px"></NVBlock>

Result

<div style="border-top-left-radius: 2px; border-top-right-radius: 2px;border-bottom-right-radius: 2px; border-bottom-left-radius: 2px;"></div>

Code

<NVBlock BorderRadius="2px 4px">

Result

<div style="border-top-left-radius: 2px; border-top-right-radius: 4px;border-bottom-right-radius: 2px; border-bottom-left-radius: 4px;"></div>

Code

<NVBlock BorderRadius="4px . . ."></NVBlock>

Result

<div style="border-top-left-radius: 4px;"></div>

Code

<NVBlock BorderRadius=". . . 4px"></NVBlock>

Result

<div style="border-bottom-left-radius: 4px;"></div>

BorderWidth

Use the logic of Padding/Margin for the position of the borders.

The dot (.) will omit value on the corresponding position (top, left, right or bottom).

TypeDefault Value
stringnull

Code

<NVBlock BorderWidth="0 ."></NVBlock>

Result

<div class="border-t-0 border-b-0"></div>

Code

<NVBlock BorderWidth="0 1 2"></NVBlock>

Result

<div class="border-t-0 border-r border-b-2 border-l"></div>

Code

<NVBlock BorderWidth="1 2 4 8"></NVBlock>

Result

<div class="border-t border-r-2 border-b-4 border-l-8"></div>

Code

<NVBlock BorderWidth="1 2 . 8"></NVBlock>

Result

<div class="border-t border-r-2 border-l-8"></div>

Bottom

Set the bottom position of the element.

TypeDefault Value
stringnull

Code

<NVBlock Bottom="0"></NVBlock>

Result

<div style="bottom:0;"></div>

ChildContent

Default RenderFragment for children.

TypeDefault Value
RenderFragmentnull

Code

<NVBlock>
  <NVBlock Class="child-content"></NVBlock>
</NVBlock>

Result

<div>
  <div class="child-content"></div>
</div>

ChildMargin

Set the padding of all children of the element.
The dot (.) will set no value on the position.
Positions logic are: top, right, bottom, left.

TypeDefault Value
stringnull

Code

<NVBlock ChildMargin="1 . ."></NVBlock>

Result

<div class="cmt-1"></div>

Code

<NVBlock ChildMargin="1"></NVBlock>

Result

<div class="cm-1"></div>

Code

<NVBlock ChildMargin="1 2"></NVBlock>

Result

<div class="cmy-1 cmx-2"></div>

Code

<NVBlock ChildMargin="1 2 3"></NVBlock>

Result

<div class="cmt-1 cmx-2 cmb-3"></div>

Code

<NVBlock ChildMargin="1 2 3 4"></NVBlock>

Result

<div class="cmt-1 cmr-2 cmb-3 cml-4"></div>

ChildPadding

Set the padding of all children of the element.
The dot (.) will set no value on the position.
Positions logic are: top, right, bottom, left.

TypeDefault Value
stringnull

Code

<NVBlock ChildPadding="1 . ."></NVBlock>

Result

<div class="cpt-1"></div>

Code

<NVBlock ChildPadding="1"></NVBlock>

Result

<div class="cp-1"></div>

Code

<NVBlock ChildPadding="1 2"></NVBlock>

Result

<div class="cpy-1 cpx-2"></div>

Code

<NVBlock ChildPadding="1 2 3"></NVBlock>

Result

<div class="cpt-1 cpx-2 cpb-3"></div>

Code

<NVBlock ChildPadding="1 2 3 4"></NVBlock>

Result

<div class="cpt-1 cpr-2 cpb-3 cpl-4"></div>

Class

Add the attribute class.

TypeDefault Value
stringnull

Code

<NVBlock Class="sample"></NVBlock>

Result

<div class="sample"></div>

CM

Shortcut for ChildMargin.

TypeDefault Value
stringnull

CMB

Add child margin bottom class.

TypeDefault Value
stringnull

Code

<NVBlock CMB="1"></NVBlock>

Result

<div class="cmb-1"></div>

CML

Add child margin left class.

TypeDefault Value
stringnull

Code

<NVBlock CML="1"></NVBlock>

Result

<div class="cml-1"></div>

CMR

Add child margin right class.

TypeDefault Value
stringnull

Code

<NVBlock CMR="1"></NVBlock>

Result

<div class="cmr-1"></div>

CMT

Add child margin top class.

TypeDefault Value
stringnull

Code

<NVBlock CMT="1"></NVBlock>

Result

<div class="cmt-1"></div>

CMX

Add child margin left and right class.

TypeDefault Value
stringnull

Code

<NVBlock CMX="1"></NVBlock>

Result

<div class="cmx-1"></div>

CMY

Add child margin top and bottom class.

TypeDefault Value
stringnull

Code

<NVBlock CMY="1"></NVBlock>

Result

<div class="cmy-1"></div>

Color

Contextual color depending of the component.
By default act as a BackgroundColor parameter.

TypeDefault Value
stringnull

Code

<NVButton Color="orange-500"> </NVButton>

Result

<button class="nv-btn nv-btn-md nv-btn-level-1 orange-500"></button>

Code

<NVButton Color="#F00"> </NVButton>

Result

<button class="nv-btn nv-btn-md nv-btn-level-1 neutral" style="background-color: #F00"></button>

ColSize

Add the class to specify that the component is a column and has a specific size.

TypeDefault Value
stringnull

Code

<NVBlock ColSize="2"></NVBlock>

Result

<div class="nv-col w-2/12"></div>

Content

Utilities for controlling how rows are positioned in multi-row flex and grid containers.

TypeDefault Value
stringnull

Code

<NVBlock Content="@Content.START"></NVBlock>

Result

<div class="content-start"></div>

Code

<NVBlock Content="@Content.END"></NVBlock>

Result

<div class="content-end"></div>

CP

Shortcut for ChildPadding.

TypeDefault Value
stringnull

CPB

Add child padding bottom class.

TypeDefault Value
stringnull

Code

<NVBlock CPB="1">
  <div>Child with padding bottom of 4px</div>
  <div>Child with padding bottom of 4px</div>
</NVBlock>

Result

<div class="cpb-1">
  <div>Child with padding bottom of 4px</div>
  <div>Child with padding bottom of 4px</div>
</div>

CPL

Add child padding left class.

TypeDefault Value
stringnull

Code

<NVBlock CPL="1">
  <div>Child with padding left of 4px</div>
  <div>Child with padding left of 4px</div>
</NVBlock>

Result

<div class="cpl-1">
  <div>Child with padding left of 4px</div>
  <div>Child with padding left of 4px</div>
</div>

CPR

Add child padding right class.

TypeDefault Value
stringnull

Code

<NVBlock CPR="1">
  <div>Child with padding right of 4px</div>
  <div>Child with padding right of 4px</div>
</NVBlock>

Result

<div class="cpr-1">
  <div>Child with padding right of 4px</div>
  <div>Child with padding right of 4px</div>
</div>

CPT

Add child padding top class.

TypeDefault Value
stringnull

Code

<NVBlock CPT="1">
  <div>Child with padding top of 4px</div>
  <div>Child with padding top of 4px</div>
</NVBlock>

Result

<div class="cpt-1">
  <div>Child with padding top of 4px</div>
  <div>Child with padding top of 4px</div>
</div>

CPX

Add child padding left and right class.

TypeDefault Value
stringnull

Code

<NVBlock CPX="1">
  <div>Child with padding left and right of 4px</div>
  <div>Child with padding left and right of 4px</div>
</NVBlock>

Result

<div class="cpx-1">
  <div>Child with padding left and right of 4px</div>
  <div>Child with padding left and right of 4px</div>
</div>

CPY

Add child padding top and bottom class.

TypeDefault Value
stringnull

Code

<NVBlock CPY="1">
  <div>Child with padding top and bottom of 4px</div>
  <div>Child with padding top and bottom of 4px</div>
</NVBlock>

Result

<div class="cpy-1">
  <div>Child with padding left of 4px</div>
  <div>Child with padding left of 4px</div>
</div>

DicClass

Dictionary used to add a class when the bool value of a key is true.

TypeDefault Value
Dictionary<string, bool>null

Code

<NVBlock DicClass="@(new Dictionary<string, bool>() {
  {"border", true},
  {"border-gray-200", true},
  {"app-sidebar-close", false},
)"></NVBlock

Result

<div class="border border-gray-200"></div>

Direction

Utilities for controlling the direction of the flex container.

TypeDefault Value
stringnull

Code

<NVBlock Direction="@Direction.ROW"></NVBlock>

Result

<div class="flex-row"></div>

Code

<NVBlock Direction="@Direction.COLUMN_REVERSE"></NVBlock>

Result

<div class="flex-col-reverse"></div>

Disabled

Add the attribute disabled.

TypeDefault Value
boolfalse

Code

<NVButton Disabled> </NVButton>

Result

<button disabled></button>

Code

<NVBlock Tag="input" Disabled></NVBlock>

Result

<input disabled />

Code

<NVBlock Disabled></NVBlock>

Result

<div></div>

Display

Set the display of the element.

TypeDefault Value
stringnull

Code

<NVBlock Display="@Display.HIDDEN"></NVBlock>

Result

<div class="hidden"></div>

Code

<NVBlock Display="@Display.BLOCK"></NVBlock>

Result

<div class="block"></div>

Code

<NVBlock Display="@Display.INLINE"></NVBlock>

Result

<div class="inline"></div>

FontSize

Set a font-size to the element.

TypeDefault Value
stringnull

Code

<NVBlock FontSize="16px"></NVBlock>

Result

<div style="font-size:16px;"></div>

FontWeight

Set the text alignment of the element.

TypeDefault Value
stringnull

Code

<NVBlock FontWeight="@FontWeight.NORMAL"></NVBlock>

Result

<div class="font-normal"></div>

Code

<NVBlock FontWeight="@FontWeight.MEDIUM"></NVBlock>

Result

<div class="font-medium"></div>

Code

<NVBlock FontWeight="FontWeight.BOLD"></NVBlock>

Result

<div class="font-bold"></div>

GCM

Shortcut for GrandChildMargin.

TypeDefault Value
stringnull

GCMB

Add grand child margin bottom class.

TypeDefault Value
stringnull

Code

<NVBlock GCMB="1"></NVBlock>

Result

<div class="gcmb-1"></div>

GCML

Add grand child margin left class.

TypeDefault Value
stringnull

Code

<NVBlock GCML="1"></NVBlock>

Result

<div class="gcml-1"></div>

GCMR

Add grand child margin right class.

TypeDefault Value
stringnull

Code

<NVBlock GCMR="1"></NVBlock>

Result

<div class="gcmr-1"></div>

GCMT

Add grand child margin top class.

TypeDefault Value
stringnull

Code

<NVBlock GCMT="1"></NVBlock>

Result

<div class="gcmt-1"></div>

GCMX

Add grand child margin left and right class.

TypeDefault Value
stringnull

Code

<NVBlock GCMX="1"></NVBlock>

Result

<div class="gcmx-1"></div>

GCMY

Add grand child margin top and bottom class.

TypeDefault Value
stringnull

Code

<NVBlock GCMY="1"></NVBlock>

Result

<div class="gcmy-1"></div>

GCP

Shortcut for GrandChildPadding.

TypeDefault Value
stringnull

GCPB

Add grand child padding bottom class.

TypeDefault Value
stringnull

Code

<NVBlock GCPB="1">
  <div>
    <div>Grand Child with padding bottom of 4px</div>
    <div>Grand Child with padding bottom of 4px</div>
  </div>
</NVBlock>

Result

<div class="gcpb-1">
  <div>
    <div>Grand Child with padding bottom of 4px</div>
    <div>Grand Child with padding bottom of 4px</div>
  </div>
</div>

GCPL

Add grand child padding left class.

TypeDefault Value
stringnull

Code

<NVBlock GCPL="1">
  <div>
    <div>Grand Child with padding left of 4px</div>
    <div>Grand Child with padding left of 4px</div>
  </div>
</NVBlock>

Result

<div class="gcpl-1">
  <div>
    <div>Grand Child with padding left of 4px</div>
    <div>Grand Child with padding left of 4px</div>
  </div>
</div>

GCPR

Add grand child padding right class.

TypeDefault Value
stringnull

Code

<NVBlock GCPR="1">
  <div>
    <div>Grand Child with padding right of 4px</div>
    <div>Grand Child with padding right of 4px</div>
  </div>
</NVBlock>

Result

<div class="gcpr-1">
  <div>
    <div>Grand Child with padding right of 4px</div>
    <div>Grand Child with padding right of 4px</div>
  </div>
</div>

GCPT

Add grand child padding top class.

TypeDefault Value
stringnull

Code

<NVBlock GCPT="1">
  <div>
    <div>Grand Child with padding top of 4px</div>
    <div>Grand Child with padding top of 4px</div>
  </div>
</NVBlock>

Result

<div class="gcpt-1">
  <div>
    <div>Grand Child with padding top of 4px</div>
    <div>Grand Child with padding top of 4px</div>
  </div>
</div>

GCPX

Add grand child padding left and right class.

TypeDefault Value
stringnull

Code

<NVBlock GCPX="1">
  <div>
    <div>
      Grand Child with padding left and right of 4px
    </div>
    <div>
      Grand Child with padding left and right of 4px
    </div>
  </div>
</NVBlock>

Result

<div class="gcpx-1">
  <div>
    <div>
      Grand Child with padding left and right of 4px
    </div>
    <div>
      Grand Child with padding left and right of 4px
    </div>
  </div>
</div>

GCPY

Add grand child padding top and bottom class.

TypeDefault Value
stringnull

Code

<NVBlock GCPY="1">
  <div>
    <div>
      Grand Child with padding top and bottom of 4px
    </div>
    <div>
      Grand Child with padding top and bottom of 4px
    </div>
  </div>
</NVBlock>

Result

<div class="gcpy-1">
  <div>
    <div>
      Grand Child with padding top and bottom of 4px
    </div>
    <div>
      Grand Child with padding top and bottom of 4px
    </div>
  </div>
</div>

GrandChildMargin

Set the margin of all children of children of the element.
The dot (.) will set no value on the position.
Positions logic are: top, right, bottom, left.

TypeDefault Value
stringnull

Code

<NVBlock GrandChildMargin="1 . ."></NVBlock>

Result

<div class="gcmt-1"></div>

Code

<NVBlock GrandChildMargin="1"></NVBlock>

Result

<div class="gcm-1"></div>

Code

<NVBlock GrandChildMargin="1 2"></NVBlock>

Result

<div class="gcmy-1 gcmx-2"></div>

Code

<NVBlock GrandChildMargin="1 2 3"></NVBlock>

Result

<div class="gcmt-1 gcmx-2 gcmb-3"></div>

Code

<NVBlock GrandChildMargin="1 2 3 4"></NVBlock>

Result

<div class="gcmt-1 gcmr-2 gcmb-3 gcml-4"></div>

GrandChildPadding

Set the padding of all children of children of the element.
The dot (.) will set no value on the position.
positions logic are: top, right, bottom, left.

TypeDefault Value
stringnull

Code

<NVBlock GrandChildPadding="1 . ."></NVBlock>

Result

<div class="gcpt-1"></div>

Code

<NVBlock GrandChildPadding="1"></NVBlock>

Result

<div class="gcp-1"></div>

Code

<NVBlock GrandChildPadding="1 2"></NVBlock>

Result

<div class="gcpy-1 gcpx-2"></div>

Code

<NVBlock GrandChildPadding="1 2 3"></NVBlock>

Result

<div class="gcpt-1 gcpx-2 gcpb-3"></div>

Code

<NVBlock GrandChildPadding="1 2 3 4"></NVBlock>

Result

<div class="gcpt-1 gcpr-2 gcpb-3 gcpl-4"></div>

Grow

Set the growing of an element in a flex container.

TypeDefault Value
stringnull

Code

<NVBlock Grow="0"></NVBlock>

Result

<div class="flex-grow-0"></div>

Code

<NVBlock Grow="1"></NVBlock>

Result

<div class="flex-grow"></div>

GutterX

Set margin on x axe between children elements.

TypeDefault Value
stringnull

Code

<NVBlock GutterX="2"></NVBlock>

Result

<div class="gutter-x-2"></div>

GutterY

Set margin on y axe between children elements.

TypeDefault Value
stringnull

Code

<NVBlock GutterY="2"></NVBlock>

Result

<div class="gutter-y-2"></div>

Height

Add height in the inline style of the element.

TypeDefault Value
stringnull

Code

<NVBlock Height="100px"></NVBlock>

Result

<div style="height:100px;"></div>

Code

<NVBlock Height="50%"></NVBlock>

Result

<div style="height:50%;"></div>

Code

<NVBlock Height="50vh"></NVBlock>

Result

<div style="height:50vh;"></div>

HFull

Add the class to specify that the element get a height of 100%.

TypeDefault Value
boolfalse

Code

<NVBlock HFull></NVBlock>

Result

<div class="h-full"></div>

Hover

Add the hover class to get default behavior of hovered background theme class.

TypeDefault Value
boolfalse

Code

<NVBlock Color="orange-500" Hover></NVBlock>

Result

<div class="bg-orange-500 hover"></div>

Href

Add the attribute href to link element.

TypeDefault Value
stringnull

Code

<NVBlock Tag="a" Href="https://google.com"></NVBlock>

Result

<a href="http://a-url.com"></a>

Code

<NVBlock Href="https://google.com"></NVBlock>

Result

<div></div>

Id

Add the attribute id.

TypeDefault Value
stringnull

Code

<NVBlock Id="sample"></NVBlock>

Result

<div id="sample"></div>

IsActive

Add the class to specify that the element has 'is-active' class.

TypeDefault Value
boolfalse

Code

<NVBlock IsActive></NVBlock>

Result

<div class="is-active"></div>

IsSelected

Add the class to specify that the element has 'is-selected' class.

TypeDefault Value
boolfalse

Code

<NVBlock IsSelected></NVBlock>

Result

<div class="is-selected"></div>

Items

Utilities for controlling how flex and grid items are positioned along a container's cross axis.

TypeDefault Value
stringnull

Code

<NVBlock Items="@Items.START"></NVBlock>

Result

<div class="items-start"></div>

Code

<NVBlock Items="@Items.END"></NVBlock>

Result

<div class="items-end"></div>

Justify

Utilities for controlling how flex and grid items are positioned along a container's main axis.

TypeDefault Value
stringnull

Code

<NVBlock Justify="@Justify.START"></NVBlock>

Result

<div class="justify-start"></div>

Code

<NVBlock Justify="@Justify.END"></NVBlock>

Result

<div class="justify-end"></div>

JustifySelf

Utilities for controlling how an individual grid item is aligned along its inline axis.

TypeDefault Value
stringnull

Code

<NVBlock JustifySelf="@JustifySelf.START"></NVBlock>

Result

<div class="justify-self-start"></div>

Code

<NVBlock JustifySelf="@JustifySelf.END"></NVBlock>

Result

<div class="justify-self-end"></div>

Left

Set the left position of the element.

TypeDefault Value
stringnull

Code

<NVBlock Left="0"></NVBlock>

Result

<div style="left:0;"></div>

LG

LG parameters apply specified parameters when the screen has the large breakpoint width.
(lg breakpoint: between 1024px and above),

TypeDefault Value
objectnull

LinearGradient

Add linear-gradient in the inline style of the element.

TypeDefault Value
stringnull

Code

<NVBlock LinearGradient="to bottom, red 20%, blue 70%">

Result

<div style="linear-gradient:to bottom, red 20%, blue 70%;"></div>

M

Shortcut for Margin.

TypeDefault Value
stringnull

Margin

Set the margin of the element.
The dot (.) will set no value on the position.
Positions logic are: top, right, bottom, left.

TypeDefault Value
stringnull

Code

<NVBlock Margin="1 . ."></NVBlock>

Result

<div class="mt-1"></div>

Code

<NVBlock Margin="1"></NVBlock>

Result

<div class="m-1"></div>

Code

<NVBlock Margin="1 2"></NVBlock>

Result

<div class="my-1 mx-2"></div>

Code

<NVBlock Margin="1 2 3"></NVBlock>

Result

<div class="mt-1 mx-2 mb-3"></div>

Code

<NVBlock Margin="1 2 3 4"></NVBlock>

Result

<div class="mt-1 mr-2 mb-3 ml-4"></div>

Code

<NVBlock Margin="1px . ."></NVBlock>

Result

<div style="margin-top:1px;"></div>

Code

<NVBlock Margin="1px">

Result

<div style="margin-top:1px;margin-right:1px;margin-bottom:1px;margin-left:1px;"></div>

Code

<NVBlock Margin="1px 2px"></NVBlock>

Result

<div style="margin-top:1px;margin-right:2px;margin-bottom:1px;margin-left:2px;"></div>

Code

<NVBlock Margin="1px 2px 3px"></NVBlock>

Result

<div style="margin-top:1px;margin-right:2px;margin-bottom:3px;margin-left:2px;"></div>

Code

<NVBlock Margin="1px 2px 3px 4px"></NVBlock>

Result

<div style="margin-top:1px;margin-right:2px;margin-bottom:3px;margin-left:4px;"></div>

MaxHeight

Add max-height in the inline style of the element.

TypeDefault Value
stringnull

Code

<NVBlock MaxHeight="100px"></NVBlock>

Result

<div style="max-height:100px;"></div>

Code

<NVBlock MaxHeight="50%"></NVBlock>

Result

<div style="max-height:50%;"></div>

Code

<NVBlock MaxHeight="50vh"></NVBlock>

Result

<div style="max-height:50vh;"></div>

MaxWidth

Add max-width in the inline style of the element.

TypeDefault Value
stringnull

Code

<NVBlock MaxWidth="100px"></NVBlock>

Result

<div style="max-width:100px;"></div>

Code

<NVBlock MaxWidth="50%"></NVBlock>

Result

<div style="max-width:50%;"></div>

Code

<NVBlock MaxWidth="50vw"></NVBlock>

Result

<div style="max-width:50vw;"></div>

MB

Add margin bottom class.

TypeDefault Value
stringnull

Code

<NVBlock MB="1"></NVBlock>

Result

<div class="mb-1"></div>

MD

MD parameters apply specified parameters when the screen has the medium breakpoint width.
(md breakpoint: between 768px and above),

TypeDefault Value
objectnull

MinHeight

Add min-height in the inline style of the element.

TypeDefault Value
stringnull

Code

<NVBlock MinHeight="100px"></NVBlock>

Result

<div style="min-height:100px;"></div>

Code

<NVBlock MinHeight="50%"></NVBlock>

Result

<div style="min-height:50%;"></div>

Code

<NVBlock MinHeight="50vh"></NVBlock>

Result

<div style="min-height:50vh;"></div>

MinWidth

Add min-width in the inline style of the element.

TypeDefault Value
stringnull

Code

<NVBlock MinWidth="100px"></NVBlock>

Result

<div style="min-width:100px;"></div>

Code

<NVBlock MinWidth="50%"></NVBlock>

Result

<div style="min-width:50%;"></div>

Code

<NVBlock MinWidth="50vw"></NVBlock>

Result

<div style="min-width:50vw;"></div>

ML

Add margin left class.

TypeDefault Value
stringnull

Code

<NVBlock ML="1"></NVBlock>

Result

<div class="ml-1"></div>

MR

Add margin right class.

TypeDefault Value
stringnull

Code

<NVBlock MR="1"></NVBlock>

Result

<div class="mr-1"></div>

MT

Add margin top class.

TypeDefault Value
stringnull

Code

<NVBlock MT="1"></NVBlock>

Result

<div class="mt-1"></div>

MX

Add margin left and right class.

TypeDefault Value
stringnull

Code

<NVBlock MX="1"></NVBlock>

Result

<div class="mx-1"></div>

MY

Add margin top and bottom class.

TypeDefault Value
stringnull

Code

<NVBlock MY="1"></NVBlock>

Result

<div class="my-1"></div>

OnBlur

Add a focus event callback when the element is blurred.

TypeDefault Value
EventCallback<FocusEventArgs>null

Code

<NVBlock Tag="input" OnBlur="OnBlur"></NVBlock>

OnChange

Add a change event callback when the input value is changed.

TypeDefault Value
EventCallback<ChangeEventArgs>null

Code

<NVBlock Tag="input" OnChange="@OnChange"></NVBlock>

OnClick

Add a mouse event callback when element is clicked.

TypeDefault Value
EventCallback<MouseEventArgs>null

Code

<NVBlock OnClick="@OnClick"></NVBlock>

OnFocus

Add a focus event callback when the element is focused.

TypeDefault Value
EventCallback<FocusEventArgs>null

Code

<NVBlock Tag="input" OnFocus="@OnFocus"></NVBlock>

OnInput

Add a change event callback when the input value is modified.

TypeDefault Value
EventCallback<ChangeEventArgs>null

Code

<NVBlock Tag="input" OnInput="@OnInput"></NVBlock>

OnKeyDown

Add a keyboard event callback when the a keyboard key is down.

TypeDefault Value
EventCallback<KeyboardEventArgs>null

Code

<NVBlock Tag="input" OnKeyDown="@OnKeyDown"></NVBlock>

OnKeyPress

Add a keyboard event callback when the a keyboard key is press.

TypeDefault Value
EventCallback<KeyboardEventArgs>null

Code

<NVBlock Tag="input" OnKeyPress="@OnKeyPress"></NVBlock>

OnKeyUp

Add a keyboard event callback when the a keyboard key is released.

TypeDefault Value
EventCallback<KeyboardEventArgs>null

Code

<NVBlock Tag="input" OnKeyUp="@OnKeyUp">

OnMouseDown

Add a mouse event callback when the mouse is clicked down on the element.

TypeDefault Value
EventCallback<MouseEventArgs>null

Code

<NVBlock OnMouseDown="@OnMouseDown"></NVBlock>

OnMouseEnter

Add a mouse event callback when the mouse enter over the element.

TypeDefault Value
EventCallback<MouseEventArgs>null

Code

<NVBlock OnMouseEnter="@OnMouseEnter"></NVBlock>

OnMouseLeave

Add a mouse event callback when the mouse leave from the element.

TypeDefault Value
EventCallback<MouseEventArgs>null

Code

<NVBlock OnMouseLeave="@OnMouseLeave"></NVBlock>

OnMouseMove

Add a mouse event callback when the mouse move within element.

TypeDefault Value
EventCallback<MouseEventArgs>null

Code

<NVBlock OnMouseMove="@OnMouseMove"></NVBlock>

OnMouseOut

Add a mouse event callback when the mouse is out the element.

TypeDefault Value
EventCallback<MouseEventArgs>null

Code

<NVBlock OnMouseOut="@OnMouseOut"></NVBlock>

OnMouseOver

Add a mouse event callback when the mouse is over the element.

TypeDefault Value
EventCallback<MouseEventArgs>null

Code

<NVBlock OnMouseOver="@OnMouseOver"></NVBlock>

OnMouseUp

Add a mouse event callback when the mouse is clicked up on the element.

TypeDefault Value
EventCallback<MouseEventArgs>null

Code

<NVBlock OnMouseUp="@OnMouseUp"></NVBlock>

Opacity

Set the opacity of the element.

TypeDefault Value
stringnull

Code

<NVBlock Opacity="0"></NVBlock>

Result

<div class="opacity-0"></div>

Overflow

Set a font-size and a line-height to the element.

TypeDefault Value
stringnull

Code

<NVBlock Overflow="@Overflow.AUTO"></NVBlock>

Result

<div class="overflow-auto"></div>

Code

<NVBlock Overflow="@($"Overflow.HIDDEN Overflow.AUTO")">

Result

<div class="overflow-x-hiden overflow-y-auto">

P

Shortcut for Padding.

TypeDefault Value
stringnull

Pad

Define a specific padding on children of the elements.
If the value is set to 1, the y padding value is set to 1 and the x padding is set to 2.

TypeDefault Value
stringnull

Code

<NVBlock Pad="1"></NVBlock>

Result

<div class="cpy-1 cpx-2"></div>

Pad

Define a specific padding on children of the elements.
If the value is set to 1, the y padding value is set to 1 and the x padding is set to 2.

TypeDefault Value
stringnull

Code

<NVBlock Pad="1"></NVBlock>

Result

<div class="cpy-1 cpx-2"></div>

Padding

Set the padding of the element.
The dot (.) will set no value on the position.
Positions logic are: top, right, bottom, left.

TypeDefault Value
stringnull

Code

<NVBlock Padding="1 . ."></NVBlock>

Result

<div class="pt-1"></div>

Code

<NVBlock Padding="1"></NVBlock>

Result

<div class="p-1"></div>

Code

<NVBlock Padding="1 2"></NVBlock>

Result

<div class="py-1 px-2"></div>

Code

<NVBlock Padding="1 2 3"></NVBlock>

Result

<div class="pt-1 px-2 pb-3"></div>

Code

<NVBlock Padding="1 2 3 4"></NVBlock>

Result

<div class="pt-1 pr-2 pb-3 pl-4"></div>

Code

<NVBlock Padding="1px . ."></NVBlock>

Result

<div style="padding-top:1px;"></div>

Code

<NVBlock Padding="1px">

Result

<div style="padding-top:1px;padding-right:1px;padding-bottom:1px;padding-left:1px;"></div>

Code

<NVBlock Padding="1em 2px">

Result

<div style="padding-top:1em;padding-right:2px;padding-bottom:1em;padding-left:2px;"></div>

Code

<NVBlock Padding="1% 2em 3px">

Result

<div style="padding-top:1%;padding-right:2em;padding-bottom:3px;padding-left:2em;"></div>

Code

<NVBlock Padding="1px 2px 3px 4px">

Result

<div style="padding-top:1px;padding-right:2px;padding-bottom:3px;padding-left:4px;"></div>

PB

Add padding bottom class.

TypeDefault Value
stringnull

Code

<NVBlock PB="1"></NVBlock>

Result

<div class="pb-1"></div>

PL

Add padding left class.

TypeDefault Value
stringnull

Code

<NVBlock PL="1"></NVBlock>

Result

<div class="pl-1"></div>

Position

Set the display of the element.

TypeDefault Value
stringnull

Code

<NVBlock Position="@Position.RELATIVE"></NVBlock>

Result

<div class="relative"></div>

Code

<NVBlock Position="@Position.ABSOLUTE"></NVBlock>

Result

<div class="absolute"></div>

PR

Add padding right class.

TypeDefault Value
stringnull

Code

<NVBlock PR="1"></NVBlock>

Result

<div class="pr-1"></div>

PreventDefault

Remove the preventDefault action of the event.

You can preventDefault multiple events by entering a string composed of event names separated by a white space.

TypeDefault Value
stringnull

Code

<NVButton PreventDefault="onclick" OnClick="@OnClick">button </NVButton>

Code

<NVFieldText PreventDefault="onkeydown onkeyup" OnKeyDown="@OnKeyDown" OnKeyUp="@OnKeyUp" />

PT

Add padding top class.

TypeDefault Value
stringnull

Code

<NVBlock PT="1"></NVBlock>

Result

<div class="pt-1"></div>

PX

Add padding left and right class.

TypeDefault Value
stringnull

Code

<NVBlock PX="1"></NVBlock>

Result

<div class="px-1"></div>

PY

Add padding top and bottom class.

TypeDefault Value
stringnull

Code

<NVBlock PY="1"></NVBlock>

Result

<div class="py-1"></div>

Row

Add the class to specify that the component is a row.

TypeDefault Value
boolfalse

Code

<NVBlock Row>

Result

<div class="nv-row"></div>

Self

Utilities for controlling how an individual flex or grid item is positioned along its container's cross axis.

TypeDefault Value
stringnull

Code

<NVBlock Self="@Self.AUTO"></NVBlock>

Result

<div class="self-auto"></div>

Code

<NVBlock Self="@Self.START"></NVBlock>

Result

<div class="self-start"></div>

SetRef

Action that set the ElementReference of the component.
Sometimes it's useful to get the reference of the html element to manipulate it by javascript.

TypeDefault Value
Action<ElementReference>null

Code

<NVBlock SetRef="@OnSetRef"></NVBlock>
...  
void OnSetRef(ElementReference r)
{
  // DO SOMETHING WITH THE ELEMENT REFERENCE
}

Result

<div></div>

Code

<ParentComponent ChildRef="ForwardRef">
  <NVBlock SetRef="@OnSetRef"></NVBlock>
</ParentComponent>
...  
public ForwardRef ForwardRef { get; set; } = new ForwardRef();

void OnSetRef(ElementReference r)
{
  // use a ForwardRef when another 
  // component need it 
  
  ForwardRef.Current = r;
}

Result

<div></div>

Shrink

Set the Shrinking of an element in a flex container.

TypeDefault Value
stringnull

Code

<NVBlock Shrink="0"></NVBlock>

Result

<div class="flex-shrink-0"></div>

Code

<NVBlock Shrink="1"></NVBlock>

Result

<div class="flex-shrink"></div>

SM

SM parameters apply specified parameters when the screen has the small breakpoint width.
(sm breakpoint: between 640px and above)

TypeDefault Value
objectnull

Src

Add the attribute src to img element.

TypeDefault Value
stringnull

Code

<NVBlock Tag="img" Src="http://hanami.be/img/logo.gif"></NVBlock>

Result

<img src="http://hanami.be/img/logo.gif" />

Stack

Add the class to specify that the component is a stack.

TypeDefault Value
boolfalse

Code

<NVBlock Stack />

Result

<div class="nv-stack"></div>

StackFlex

Add the class to specify that all children of the component are flexible.

TypeDefault Value
boolfalse

Code

<NVBlock StackFlex />

Result

<div class="nv-stack stack-flex"></div>

StackItemFlex

Add the class to specify that the element within a stack is flexible.

TypeDefault Value
boolfalse

Code

<NVBlock StackItemFlex />

Result

<div class="nv-stack-item-flex"></div>

StackItemLead

Add the class to specify that the element within a stack is the lead.

TypeDefault Value
boolfalse

Code

<NVBlock StackItemLead />

Result

<div class="nv-stack-item-lead"></div>

StackItemTail

Add the class to specify that the element within a stack is the tail.

TypeDefault Value
boolfalse

Code

<NVBlock StackItemTail />

Result

<div class="nv-stack-item-tail"></div>

StackVertical

Add the class to specify that the component is a vertical stack.

TypeDefault Value
boolfalse

Code

<NVBlock StackVertical />

Result

<div class="nv-stack nv-stack-vertical"></div>

StopPropagation

Remove the propagation of an event.

You can remove propagation of multiple events by entering a string composed of event names separated by a white space.

TypeDefault Value
stringnull

Code

<NVButton StopPropagation="onclick" OnClick="@OnClick">button </NVButton>

Code

<NVFieldText StopPropagation="onmouseleave onmouseenter" OnMouseEnter="@OnMouseEnter" OnMouseLeave="@OnMouseLeave" />

Style

Add the attribute style.

TypeDefault Value
stringnull

Code

<NVBlock Style="font-weight:bold;"></NVBlock>

Result

<div style="font-weight:bold;"></div>

Tag

Apply the tag value on the component.

TypeDefault Value
stringnull

Code

<NVBlock></NVBlock>

Result

<div></div>

Code

<NVBlock Tag="a"></NVBlock>

Result

<a></a>

Code

<NVBlock Tag="strong"></NVBlock>

Result

<strong></strong>

Target

Add the attribute target to link element.

TypeDefault Value
stringnull

Code

<NVBlock Tag="a" Target="_target"></NVBlock>

Result

<a target="_blank"></a>

Code

<NVBlock Target="_target"></NVBlock>

Result

<div></div>

TextAlign

Set the text alignment of the element.

TypeDefault Value
stringnull

Code

<NVBlock TextAlign="@TextAlign.CENTER"></NVBlock>

Result

<div class="center"></div>

Code

<NVBlock TextAlign="@TextAlign.LEFT"></NVBlock>

Result

<div class="left"></div>

TextColor

Set the text color to the element.

TypeDefault Value
stringnull

Code

<NVBlock TextColor="orange-500"></NVBlock>

Result

<div class="text-orange-500"></div>

Code

<NVBlock TextColor="#FF0000"></NVBlock>

Result

<div style="color:#FF0000;"></div>

ActiveTextColor

Set the text color to the element when active.

TypeDefault Value
stringnull

Code

<NVButton ActiveTextColor="orange-500"> </NVButton>

Result

<button class="nv-btn active:text-orange-500"></button>

HoverTextColor

Set the text color to the element when hovered.

TypeDefault Value
stringnull

Code

<NVBlock Hover="orange-500"></NVBlock>

Result

<div class="hover:text-orange-500"></div>

TextSize

Set a font-size and a line-height to the element.

TypeDefault Value
stringnull

Code

<NVBlock TextSize="@TextSize.SM"></NVBlock>

Result

<div class="text-sm"></div>

Title

Add the attribute title to link element.

TypeDefault Value
stringnull

Code

<NVBlock Tag="a" Title="title"></NVBlock>

Result

<a title="title"></a>

Code

<NVBlock Title="title"></NVBlock>

Result

<div></div>

Top

Set the top position of the element.

TypeDefault Value
stringnull

Code

<NVBlock Top="0"></NVBlock>

Result

<div style="top:0;"></div>

VerticalAlign

Set the vertical alignment of the element.

TypeDefault Value
stringnull

Code

<NVBlock VerticalAlign="@VerticalAlign.BASELINE"></NVBlock>

Result

<div class="align-baseline"></div>

Code

<NVBlock VerticalAlign="@VerticalAlign.MIDDLE"></NVBlock>

Result

<div class="align-middle"></div>

WFull

Add the class to specify that the element get a width of 100%.

TypeDefault Value
boolfalse

Code

<NVBlock WFull></NVBlock>

Result

<div class="w-full"></div>

WhiteSpace

Set the white spacing of the element.

TypeDefault Value
stringnull

Code

<NVBlock WhiteSpace="@WhiteSpace.NOWRAP"></NVBlock>

Result

<div class="whitespace-nowrap"></div>

Width

Add width in the inline style of the element.

TypeDefault Value
stringnull

Code

<NVBlock Width="100px"></NVBlock>

Result

<div style="width:100px;"></div>

Code

<NVBlock Width="50%"></NVBlock>

Result

<div style="width:50%;"></div>

Code

<NVBlock Width="50vw"></NVBlock>

Result

<div style="width:50vw;"></div>

Wrap

Set the wrapping of a flex container.

TypeDefault Value
stringnull

Code

<NVBlock Wrap="@Wrap.WRAP"></NVBlock>

Result

<div class="flex-wrap"></div>

Code

<NVBlock Wrap="@Wrap.NOWRAP"></NVBlock>

Result

<div class="flex-nowrap"></div>

Code

<NVBlock Wrap="@Wrap.REVERSE"></NVBlock>

Result

<div class="flex-wrap-reverse"></div>

XL

XL parameters apply specified parameters when the screen has the extra large breakpoint width.
(xl breakpoint: between 1280px and above),

TypeDefault Value
objectnull

XL2

XL2 parameters apply specified parameters when the screen has the double extra large breakpoint width.
(2xl breakpoint: between 1536px and above),

TypeDefault Value
objectnull

ZIndex

Set the z-index of the element.

TypeDefault Value
stringnull

Code

<NVBlock ZIndex="0"></NVBlock>

Result

<div style="z-index:0;"></div>