Change caret icon in Blazor Dropdown Menu Component

7 Sep 20211 minute to read

Dropdown arrow can be customized on popup open and close. It can be handled in OnOpen and OnClose event.

In the following example, the up arrow is updated on popup close and down arrow is updated on popup open using OnOpen and OnClose event by adding and removing e-caret-up class.

@using Syncfusion.Blazor.SplitButtons

<SfDropDownButton CssClass="@IconCss" Content="Clipboard">
    <DropDownButtonEvents OnOpen="beforeOpen" OnClose="beforeClose"></DropDownButtonEvents>
        <DropDownMenuItem Text="Edit"></DropDownMenuItem>
        <DropDownMenuItem Text="Copy"></DropDownMenuItem>
        <DropDownMenuItem Text="Paste"></DropDownMenuItem>

@code {
    public string IconCss = "";
    private void beforeOpen(BeforeOpenCloseMenuEventArgs args)
        this.IconCss = "e-caret-up";
    private void beforeClose(BeforeOpenCloseMenuEventArgs args)
        this.IconCss = "";

    .e-caret {
        transform: rotate(0deg);
        transition: transform 200ms ease-in-out;

    .e-caret-up .e-caret {
        transform: rotate(180deg);

Output be like

Changing Caret Icon in Blazor DropDownMenu