Search results

Getting Started

This section briefly explains about how to include Blazor SplitButton in your Blazor client-side application. You can refer Getting Started with Syncfusion Blazor for Client-side in Visual Studio 2019 Preview page for introduction and configure the common specifications.

Importing Syncfusion Blazor component in the application

  1. Install Syncfusion.EJ2.Blazor NuGet package to the application by using the NuGet Package Manager. Please ensure to check the Include prerelease option.
  2. You can add the client-side resources through CDN or local npm package in the <head> element of the ~/wwwroot/index.html page.
    <environment include="Development">
        <link href="" rel="stylesheet" />
        <script src=""></script>

Adding component package to the application

Open /_Imports.razor file and import the Syncfusion.EJ2.Blazor.SplitButtons packages otherwise import these packages in the individual razor pages.

@using Syncfusion.EJ2.Blazor
@using Syncfusion.EJ2.Blazor.SplitButtons

Adding SplitButton component to the application

Now, add the Syncfusion Blazor SplitButton component in razor page in the Pages folder. For example, the SplitButton component is added in the ~/Pages/Index.razor page.

<EjsSplitButton Items="@Items">Paste</EjsSplitButton>

@code {
    public List<ItemModel> Items = new List<ItemModel>
        new ItemModel{ Text = "Cut" },
        new ItemModel{ Text = "Copy" },
        new ItemModel{ Text = "Paste" }

Run the application

After successful compilation of your application, simply press F5 to run the application. The Blazor SplitButton component will render in the web browser as shown below

Splitbutton Sample

See Also