Blazor playground

Nova v3.38.0

Preview

Blazor

BaseComponent

Replacing attribute-based styling with Tailwind classes, attribute by attribute.

Introduction#

In version 2 of our design system, Base was a foundational component used primarily to apply styling via attributes. Instead of manually writing css, developers could specify properties—such as background color, padding, or margin—directly on any component. These properties were then translated into the corresponding CSS classes behind the scenes, ensuring a standardized and consistent style across the application.

Why It’s Discontinued#

With the transition to version 3, we have fully adopted Tailwind CSS, which offers a comprehensive set of utility classes for styling. Because Tailwind covers much of the same ground as Base did, having a dedicated component to map attributes to CSS is no longer necessary. By applying Tailwind classes directly in markup, developers gain more immediate control over styling while keeping the component layer simpler and more flexible.

Additionally, our design system has grown beyond its initial .NET focus to accommodate a broader range of web technologies. Removing Base aligns with this framework-agnostic philosophy and helps streamline the overall codebase.

Tailwind Plugin for Autocompletion#

If you benefited from the convenience of attribute autocompletion, consider installing a Tailwind CSS plugin for your IDE. These plugins provide IntelliSense for utility classes (including additional utilities from Nova), making it easier to discover and apply the correct styling without memorizing every Tailwind class.

Example of Version 2 vs. Version 3#

Below are some examples showing how Base attributes in version 2 compare to Tailwind & Nova utility classes in version 3.

Blazor

Version 2 (using Base attributes)

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

Version 3 (using Tailwind classes)

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

In version 2, setting BorderRadius="sm" on <NVBlock> or <NVAlert> automatically applied the rounded-sm class. In version 3, you simply write the desired utility class (rounded-sm) in your markup.

Migration Guide#

AddClass#

Class names are passed directly to the components or html tags.

Blazor

Version 2

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

Version 3

razor<NvComponent class="text-orange-500" />

AddStyle#

Inline styles are passed directly to the components or html tags.

Blazor

Version 2

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

Version 3

razor<NvComponent style="color: #f00" />

ActiveEffect#

This has been removed and should no longer be used. Refer to the tailwind documentation for the desired effect.

Blazor

Version 2

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

Version 3

Removed, use tailwind utils for various effects

razor<NvButton class="shadow-lg" />

Alt#

Add the alt attribute directly as a native html attribute. Will work on native html elements, or any nova component.

Blazor

Version 2

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

Version 3

html<img alt="Alternate text" />

BackgroundColor#

Use tailwind’s background-color utility classes or style attributes directly.

Blazor

Version 2

razor<NVBlock BackgroundColor="orange-500"></NVBlock>
<NVAlert BackgroundColor="orange-500"></NVAlert>
<NVBlock BackgroundColor="#FF0000"></NVBlock>
<NvAlert BackgroundColor="#FF0000"></NvAlert>

Version 3

razor<div class="bg-orange-500"></div>
<NvAlert class="bg-orange-500"></NvAlert>
<div style="color: #FF0000"></div>
<NvAlert style="color: #FF0000"></NvAlert>

ActiveBackgroundColor#

Use the tailwind’s active modifier with background-color utility classes directly.

Blazor

Version 2

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

Version 3

razor<NvButton class="active:bg-orange-500"></NvButton>

HoverBackgroundColor#

Use the tailwind’s hover modifier with background-color utility classes directly.

Blazor

Version 2

razor<NVButton HoverBackgroundColor="orange-500"></NVButton>

Version 3

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

BorderColor#

Use tailwind’s border-color utility classes or style attributes directly.

Blazor

Version 2

razor<NVBlock BorderColor="orange-500"></NVBlock>
<NVBlock BorderColor="#FF0000"></NVBlock>

Version 3

html<div class="border-orange-500"></div>
<div style="border-color:#FF0000;"></div>

ActiveBorderColor#

Use the tailwind’s active modifier with border-color utility classes directly.

Blazor

Version 2

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

Version 3

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

HoverBorderColor#

Use the tailwind’s hover-modifier with border-color utility classes directly.

Blazor

Version 2

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

Version 3

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

BorderRadius#

Use tailwind’s border-radius utility classes directly.

Blazor

Version 2

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

Version 3

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

BorderWidth#

Use tailwind’s border-width utility classes directly.

Blazor

Version 2

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

Version 3

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

Bottom#

Use tailwind’s placement utility classes directly.

Blazor

Version 2

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

Version 3

html<div class="bottom-0"></div>

ChildContent#

Every Component allows child and slot components, no changes necessary.

ChildMargin#

Removed, use flexbox and tailwind’s spacing utility classes.

Blazor

Version 2

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

Version 3

html<div class="flex space-y-1 space-x-2"></div>

ChildPadding#

Removed, use flexbox and tailwind’s spacing utility classes, see ChildMargin for alternative, or add padding classes to the children directly.

Class#

Use the native html class tag directly.

Blazor

Version 2

razor<NVAlert Class="sample" />

Version 3

razor<NvAlert class="sample" />

CM#

Removed, see ChildMargin for alternative.

CMB#

Removed, see ChildMargin for alternative.

CML#

Removed, see ChildMargin for alternative.

CMR#

Removed, see ChildMargin for alternative.

CMT#

Removed, see ChildMargin for alternative.

CMX#

Removed, see ChildMargin for alternative.

CMY#

Removed, see ChildMargin for alternative.

Color#

Contextual colors are now defined via descriptive props such as emphasis or feedback. Please refer to the documentation of the individual components. If you want to directly set text color, use tailwind’s color utility classes.

Blazor

Version 2

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

Version 3

razor<NVButton Emphasis="high"></NVButton>

ColSize#

ColSize has been removed, use flex-box and grid utility classes instead for a more modern layout. Alternatively, use the deprecated components nv-stack and nv-row for a similar approach.

Content#

Use tailwind’s justify utility classes directly.

Blazor

Version 2

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

Version 3

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

CP#

Removed, see ChildPadding for details.

CPB#

Removed, see ChildPadding for details.

CPL#

Removed, see ChildPadding for details.

CPR#

Removed, see ChildPadding for details.

CPT#

Removed, see ChildPadding for details.

CPX#

Removed, see ChildPadding for details.

CPY#

Removed, see ChildPadding for details.

DicClass#

Use the @class directive directly.

Blazor

Version 2

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

Version 3

csharp<div @class=(@{
    return new Dictionary<string, bool>
    {
        { "border", true },
        { "border-gray-200", true },
        { "app-sidebar-close", false }
    }
        .Where(kvp => kvp.Value)
        .Select(kvp => kvp.Key);
})>
</div>

Direction#

Use tailwind’s flex-direction utility classes directly.

Blazor

Version 2

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

Version 3

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

Disabled#

Refer to the component or native html documentation for disabled attributes.

Blazor

Version 2

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

Version 3

razor<NvButton Disabled></NvButton> <input disabled />

Display#

Use tailwind’s display utility classes directly.

Blazor

Version 2

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

Version 3

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

FontSize#

Use tailwind’s font-size utility classes directly.

Blazor

Version 2

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

Version 3

html<div class="text-base"></div>

FontWeight#

Use tailwind’s font-weight utility classes directly.

Blazor

Version 2

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

Version 3

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

GCM#

Removed, see GrandChildMargin for details.

GCMB#

Removed, see GrandChildMargin for details.

GCML#

Removed, see GrandChildMargin for details.

GCMR#

Removed, see GrandChildMargin for details.

GCMT#

Removed, see GrandChildMargin for details.

GCMX#

Removed, see GrandChildMargin for details.

GCMY#

Removed, see GrandChildMargin for details.

GCP#

Removed, see GrandChildPadding for details.

GCPB#

Removed, see GrandChildPadding for details.

GCPL#

Removed, see GrandChildPadding for details.

GCPR#

Removed, see GrandChildPadding for details.

GCPT#

Removed, see GrandChildPadding for details.

GCPX#

Removed, see GrandChildPadding for details.

GCPY#

Removed, see GrandChildPadding for details.

GrandChildMargin#

Not supported, use CSS or Tailwind spacing utilities (gap-*, space-*, m-*) instead.

GrandChildPadding#

Not supported, use CSS or Tailwind spacing utilities (gap-*, space-*, m-*) instead.

Grow#

Use tailwind’s flex-grow utility classes directly.

Blazor

Version 2

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

Version 3

html<div class="grow"></div>

GutterX#

Use tailwind’s gap utility classes directly.

Blazor

Version 2

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

Version 3

html<div class="gap-x-2"></div>

GutterY#

Use tailwind’s gap utility classes directly.

Blazor

Version 2

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

Version 3

html<div class="gap-y-2"></div>

Height#

Use tailwind’s height utility classes directly.

Blazor

Version 2

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

Version 3

html<div class="h-[100px]"></div>

HFull#

Use tailwind’s height utility classes directly.

Blazor

Version 2

razor<NVBlock HFull></NVBlock>

Version 3

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

Hover#

Removed, rely on the components for default styles. You can use the hover modifier from tailwind for customized approaches.

Href#

Add the href directly as a native html attribute. Will work on native html elements, or any nova component.

Blazor

Version 2

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

Version 3

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

Id#

Add the id directly as a native html attribute. Will work on native html elements, or any nova component.

Blazor

Version 2

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

Version 3

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

IsActive#

Removed, rely on the components for active styles. You can use the active modifier from tailwind for customized approaches.

IsSelected#

Removed, rely on the components for selected styles.

Items#

Use tailwind’s align-items utility classes directly.

Blazor

Version 2

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

Version 3

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

Justify#

Use tailwind’s justify-content utility classes directly.

Blazor

Version 2

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

Version 3

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

JustifySelf#

Use tailwind’s justify-self utility classes directly.

Blazor

Version 2

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

Version 3

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

Left#

Use tailwind’s layout utility classes directly.

Blazor

Version 2

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

Version 3

html<div class="left-[0]"></div>

LG#

Removed, use tailwind’s media queries instead.

LinearGradient#

Use tailwind’s linear gradient utility classes directly.

Blazor

Version 2

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

Version 3

html<div class="bg-linear-to-r from-red-500 to-blue-500"></div>

M#

See Margin

Margin#

Use tailwind’s margin utility classes directly.

Blazor

Version 2

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

Version 3

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

MaxHeight#

Use tailwind’s max-height utility classes directly.

Blazor

Version 2

razor<NVBlock MaxHeight="100%"></NVBlock>

Version 3

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

MaxWidth#

Use tailwind’s max-width utility classes directly.

Blazor

Version 2

razor<NVBlock MaxWidth="100%"></NVBlock>

Version 3

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

MB#

See Margin

MD#

Removed, use tailwind’s media queries instead.

MinHeight#

Use tailwind’s min-height utility classes directly.

Blazor

Version 2

razor<NVBlock MinHeight="auto"></NVBlock>

Version 3

html<div class="min-h-auto"></div>

MinWidth#

Use tailwind’s min-width utility classes directly.

Blazor

Version 2

razor<NVBlock MinWidth="auto"></NVBlock>

Version 3

html<div class="min-w-auto"></div>

ML#

See Margin

MR#

See Margin

MT#

See Margin

MX#

See Margin

MY#

See Margin

OnBlur#

Use native event bindings from your framework.

Blazor

Version 2

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

Version 3

html<input @onblur="OnBlur" />

OnChange#

Use native event bindings from your framework.

Blazor

Version 2

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

Version 3

html<input @onchange="OnChange" />

OnClick#

Use native event bindings from your framework.

Blazor

Version 2

razor<NVButton OnClick="OnClick"></NVButton>

Version 3

razor<NvButton @onclick="OnClick"></NvButton>

OnFocus#

Use native event bindings from your framework.

Blazor

Version 2

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

Version 3

html<input @onfocus="OnFocus" />

OnInput#

Use native event bindings from your framework.

Blazor

Version 2

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

Version 3

html<input @oninput="OnInput" />

OnKeyDown#

Use native event bindings from your framework.

Blazor

Version 2

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

Version 3

html<input @onkeydown="OnKeyDown" />

OnKeyPress#

Removed, use @onkeydown

OnKeyUp#

Use native event bindings from your framework.

Blazor

Version 2

razor<NVBlock Tag="input" OnKeyUp="OnKeyUp"></NVBlock>

Version 3

html<input @onkeyup="OnKeyUp" />

OnMouseDown#

Use native event bindings from your framework.

Blazor

Version 2

razor<NVButton OnMouseDown="OnMouseDown"></NVButton>

Version 3

razor<NvButton @onmousedown="OnMouseDown"></NvButton>

OnMouseEnter#

Use native event bindings from your framework.

Blazor

Version 2

razor<NVButton OnMouseEnter="OnMouseEnter"></NVButton>

Version 3

razor<NvButton @onmouseenter="OnMouseEnter"></NvButton>

OnMouseMove#

Use native event bindings from your framework.

Blazor

Version 2

razor<NVButton OnMouseMove="OnMouseMove"></NVButton>

Version 3

razor<NvButton @onmousemove="OnMouseMove"></NvButton>

OnMouseOut#

Use native event bindings from your framework.

Blazor

Version 2

razor<NVButton OnMouseOut="OnMouseOut"></NVButton>

Version 3

razor<NvButton @onmouseout="OnMouseOut"></NvButton>

OnMouseOver#

Use native event bindings from your framework.

Blazor

Version 2

razor<NVButton OnMouseOver="OnMouseOver"></NVButton>

Version 3

razor<NvButton @onmouseover="OnMouseOver"></NvButton>

OnMouseUp#

Use native event bindings from your framework.

Blazor

Version 2

razor<NVButton OnMouseUp="OnMouseUp"></NVButton>

Version 3

razor<NvButton @onmouseup="OnMouseUp"></NvButton>

Opacity#

Use tailwind’s opacity utility classes directly.

Blazor

Version 2

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

Version 3

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

Overflow#

Use tailwind’s opacity utility classes directly.

Blazor

Version 2

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

Version 3

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

P#

See Padding

Pad#

Not supported, use CSS or Tailwind spacing utilities (gap-*, space-*, m-*) instead.

Padding#

Use tailwind’s padding utility classes directly.

Blazor

Version 2

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

Version 3

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

PB#

See Padding

PL#

See Padding

Position#

Use tailwind’s position utility classes directly.

Blazor

Version 2

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

Version 3

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

PR#

See Padding

PreventDefault#

Use native event bindings from your framework.

Blazor

Version 2

razor<NVButton PreventDefault="onclick" OnClick="OnClick"></NVButton>

Version 3

razor<NvButton @onclick:preventDefault="true" @onclick="OnClick"></NvButton>

PT#

See Padding

PX#

See Padding

PY#

See Padding

Use tailwind’s layout utility classes directly.

Blazor

Version 2

razor<NVBlock Right="0"></NVBlock>

Version 3

html<div class="right-[0]"></div>

Row#

Row has been removed, use flex-box and grid utility classes instead for a more modern layout. Alternatively, use the deprecated components nv-stack and nv-row for a similar approach.

Self#

Use tailwind’s align-self utility classes directly.

Blazor

Version 2

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

Version 3

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

SetRef#

Use native ref bindings from your framework.

Blazor

Version 2

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

Version 3

csharp<div @ref="blockRef"></div>

@code {
    private ElementReference blockRef;

    protected override void OnAfterRender(bool firstRender)
    {
        if (firstRender)
        {
            OnSetRef(blockRef);
        }
    }

    void OnSetRef(ElementReference r)
    {
        // DO SOMETHING WITH THE ELEMENT REFERENCE
        Console.WriteLine($"ElementReference acquired: {r}");
    }
}

Shrink#

Use tailwind’s flex-shrink utility classes directly.

Blazor

Version 2

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

Version 3

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

SM#

Removed, use tailwind’s media queries instead.

Src#

Add the src attribute directly as a native html attribute. Will work on native html elements, or any nova component.

Blazor

Version 2

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

Version 3

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

Stack#

Stack has been removed, use flex-box and grid utility classes instead for a more modern layout. Alternatively, use the deprecated components nv-stack and nv-row for a similar approach.

StackFlex#

StackFlex has been removed, use flex-box and grid utility classes instead for a more modern layout. Alternatively, use the deprecated components nv-stack and nv-row for a similar approach.

StackItemFlex#

StackItemFlex has been removed, use flex-box and grid utility classes instead for a more modern layout. Alternatively, use the deprecated components nv-stack and nv-row for a similar approach.

StackItemLead#

StackItemLead has been removed, use flex-box and grid utility classes instead for a more modern layout. Alternatively, use the deprecated components nv-stack and nv-row for a similar approach.

StackItemTail#

StackItemTail has been removed, use flex-box and grid utility classes instead for a more modern layout. Alternatively, use the deprecated components nv-stack and nv-row for a similar approach.

StackVertical#

StackVertical has been removed, use flex-box and grid utility classes instead for a more modern layout. Alternatively, use the deprecated components nv-stack and nv-row for a similar approach.

StopPropagation#

Use native event bindings from your framework.

Blazor

Version 2

razor<NVButton StopPropagation="onclick" OnClick="OnClick"></NVButton>

Version 3

razor<NvButton @onclick:stopPropagation="true" @onclick="OnClick"></NvButton>

Style#

Use the native html style tag directly.

Blazor

Version 2

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

Version 3

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

Tag#

Use the tag directly.

Blazor

Version 2

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

Version 3

html<a></a>

Target#

Use the native html attribute directly.

Blazor

Version 2

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

Version 3

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

TextAlign#

Use tailwind’s text-align utility classes directly.

Blazor

Version 2

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

Version 3

html<div class="text-center"></div>

TextColor#

Use tailwind’s text-color utility classes directly.

Blazor

Version 2

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

Version 3

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

ActiveTextColor#

Use the tailwind’s active modifier with text-color utility classes directly.

Blazor

Version 2

razor<NVBlock ActiveTextColor="orange-500"></NVBlock>

Version 3

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

HoverTextColor#

Use the tailwind’s hover modifier with text-color utility classes directly.

Blazor

Version 2

razor<NVBlock HoverTextColor="orange-500"></NVBlock>

Version 3

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

TextSize#

Use tailwind’s font-size utility classes directly.

Blazor

Version 2

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

Version 3

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

Title#

Use the native html attribute directly.

Blazor

Version 2

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

Version 3

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

Top#

Use tailwind’s layout utility classes directly.

Blazor

Version 2

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

Version 3

html<div class="top-[0]"></div>

VerticalAlign#

Use tailwind’s vertical-align utility classes directly.

Blazor

Version 2

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

Version 3

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

WFull#

Use tailwind’s width utility classes directly.

Blazor

Version 2

razor<NVBlock WFull></NVBlock>

Version 3

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

WhiteSpace#

Use tailwind’s white-space utility classes directly.

Blazor

Version 2

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

Version 3

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

Width#

Use tailwind’s width utility classes directly.

Blazor

Version 2

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

Version 3

html<div class="w-[100px]"></div>

Wrap#

Use tailwind’s flex-wrap utility classes directly.

Blazor

Version 2

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

Version 3

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

XL#

Removed, use tailwind’s media queries instead.

XL2#

Removed, use tailwind’s media queries instead.

ZIndex#

Use tailwind’s z-index utility classes directly.

Blazor

Version 2

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

Version 3

html<div class="z-0"></div>