Skip to content

A minimal Blazor component for dynamic generating HTML Tags

Notifications You must be signed in to change notification settings

elgransan/BlazorHtmlTag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blazor HtmlTag

A minimal component for dynamic generating HTML Tags

Installation Nuget Package

Install-Package BlazorDynamicTag

NuGet version (BlazorDynamicTag)

Use Cases

  • In general, when you create a Blazor Component but you want the user selects the base tag for the component.
  • For instance, A draggable comonent could have a "div" as base tag, but the user wants to be a list "ul" or "ol"
  • Or if you want dynamic headers

  • Or if you have a css layout and an extra "div" on a component makes the css styles break out

Usage:

  1. Add BlazorDynamicTag to your _Imports.razor
@using BlazorDynamicTag
  1. Use it in this way
<HtmlTag Tag="span" class="alert alert-primary" title="hello">
	hello <strong>!!!</strong>
</HtmlTag>

The HtmlTag will render

<span class="alert alert-primary" title="hello">
	hello <strong>!!!</strong>
</span>

About

A minimal Blazor component for dynamic generating HTML Tags

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published