This section briefly explains about how to include a
Tab in your Blazor client-side application. You can refer Getting Started with Syncfusion Blazor for Client-Side in Visual Studio 2019 Preview page for the introduction and configuring the common specifications.
Install Syncfusion.EJ2.Blazor NuGet package to the application by using the
NuGet Package Manager. Please ensure to check the
Include prerelease option.
You can add the client-side resources through CDN or local npm package in the
<head> element of the ~/wwwroot/index.html page.
<head> <link href="https://cdn.syncfusion.com/ej2/17.3.29/material.css" rel="stylesheet" /> <script src="https://cdn.syncfusion.com/ej2/17.3.29/dist/ej2.min.js"></script> </head>
~/_Imports.razor file and import the
@using Syncfusion.EJ2.Blazor @using Syncfusion.EJ2.Blazor.Navigations
Now, add the Syncfusion Blazor Tab component in any web page (razor) in the
Pages folder. For example, the Tab component is added in the
@using Syncfusion.EJ2.Blazor.Navigations <EjsTab> <TabItems> <TabItem Content="Twitter is an online social networking service that enables users to send and read short 140-charactermessages called tweets.Registered users can read and post tweets, but those who are unregistered can only readthem.Users access Twitter through the website interface, SMS or mobile device app Twitter Inc. is based in SanFrancisco and has more than 25 offices around the world.Twitter was created in March 2006 by Jack Dorsey,Evan Williams, Biz Stone, and Noah Glass and launched in July 2006. The service rapidly gained worldwide popularity,with more than 100 million users posting 340 million tweets a day in 2012.The service also handled 1.6 billionsearch queries per day."> <ChildContent> <TabHeader Text="Twitter"></TabHeader> </ChildContent> </TabItem> <TabItem Content="Facebook is an online social networking service headquartered in Menlo Park, California. Its website waslaunched on February 4, 2004, by Mark Zuckerberg with his Harvard College roommates and fellow students EduardoSaverin, Andrew McCollum, Dustin Moskovitz and Chris Hughes."> <ChildContent> <TabHeader Text="Facebook"></TabHeader> </ChildContent> </TabItem> <TabItem Content="WhatsApp Messenger is a proprietary cross-platform instant messaging client for smartphones that operatesunder a subscription business model.It uses the Internet to send text messages, images, video, user location andaudio media messages to other users using standard cellular mobile numbers. As of February 2016, WhatsApp had a userbase of up to one billion, making it the most globally popular messaging application.WhatsApp Inc., based inMountain View, California, was acquired by Facebook Inc.on February 19, 2014, for approximately US$19.3 billion."> <ChildContent> <TabHeader Text="Whatsapp"></TabHeader> </ChildContent> </TabItem> </TabItems> </EjsTab>
After successful compilation of your application, simply press
F5 to run the application.
The following code explains how to initialize tab content using
Output be like the below.