blazorfluent-ui

Is there any Fluent Component (WebComponent/Blazor) that renders into a span?


For example, I want a piece of inline text to render as a different color, how do I do that? The following code renders <FluentLabel> as p. I want something that acts like a span if possible:

<p>
    Publishing:

    @if (cat.PublishedTime is null)
    {
        <FluentLabel Color="Color.Warning">Unpublished</FluentLabel>
    }
    else
    {
        <FluentLabel>@(cat.PublishedTime)</FluentLabel>
    }
</p>

Solution

  • The maintainer suggests using Style and set it to display: inline:

    <p>
        Publishing:
    
        @if (cat.PublishedTime is null)
        {
            <FluentLabel Color="Color.Warning" Style="display: inline;">Unpublished</FluentLabel>
        }
        else
        {
            <FluentLabel Style="display: inline;">@(cat.PublishedTime)</FluentLabel>
        }
    </p>