A minimal component for dynamic generating HTML Tags
Install-Package BlazorDynamicTag
- 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
- Add BlazorDynamicTag to your _Imports.razor
@using BlazorDynamicTag
- 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>