Articles in this section
Category / Section

How to Enable Multiline Content in Blazor AppBar Using CSS?

5 mins read

To enable multiline content in the menubar within the Blazor AppBar, you can use CSS to control the wrapping and layout of the content. Follow the below shared steps to achieve your requirement:

  1. Set the CssClass for the AppBar: Ensure that the content within the rows can wrap and appear as multiline.
  2. Adjust the row and menu item CSS: Make sure the rows and menu items are flexible and can accommodate multiline text.

[index.razor]

@using Syncfusion.Blazor.Navigations
@using Syncfusion.Blazor.Buttons

<SfAppBar CssClass="footercls" ColorMode="AppBarColor.Dark" Mode="AppBarMode.Prominent" IsSticky="false" Position="AppBarPosition.Bottom">
    <label />
    <AppBarSpacer />
    <div class="row multiline-content">
        <SfMenu CssClass="e-inherit" TValue="MenuItem" EnableScrolling="true">
            <MenuItems>
                <MenuItem Text="Home" Url="/" IconCss="e-icons e-home"></MenuItem>
                <MenuItem Text="Family Browser" Url="/familybrowser"></MenuItem>
                <MenuItem Text="Bonus Tools" Url="/bonustools"></MenuItem>
                <MenuItem Text="Custom API" Url="/customapi"></MenuItem>
                <MenuItem Text="Blog" Url="/pages/web/blog"></MenuItem>
                <MenuItem Text="Support" Url="/support"></MenuItem>
                <MenuItem Text="Downloads" Url="/downloads"></MenuItem>
            </MenuItems>
        </SfMenu>
    </div>

    <div class="row multiline-content">
        <SfMenu CssClass="e-inherit" TValue="MenuItem" EnableScrolling="true">
            <MenuItems>
                <MenuItem Text="Twitter" Url="/" IconCss="bi bi-twitter"></MenuItem>
                <MenuItem Text="Facebook" Url="/" IconCss="bi bi-facebook"></MenuItem>
                <MenuItem Text="Instagram" Url="/" IconCss="bi bi-instagram"></MenuItem>
            </MenuItems>
        </SfMenu>
    </div>

    <AppBarSpacer />
    <label />
</SfAppBar>

<style>

    .footercls {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .multiline-content {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        width: 100%;
    }

    .multiline-content .e-menu-item {
        flex: 1 1 auto;
        white-space: normal;
    }

    .e-menu-wrapper .e-menu .e-menu-item .e-menu-url, .e-menu-container .e-menu .e-menu-item .e-menu-url{
      color: white !important;
    }

</style>

Sample link: https://blazorplayground.syncfusion.com/hNVfDGrSVhmRgjOW

 

Output screenshot:

 


Conclusion

I hope you enjoyed learning how to enable multiline content in Blazor AppBar using CSS.

You can refer to our Blazor AppBar feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our Blazor AppBar example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied