Animation in React Dropdown Menu

13 Nov 20265 minutes to read

Customize the React Dropdown Menu popup animation using the animationSettings property. Choose from various animation effects to provide visual feedback when the popup opens and closes.

The following animation effects are supported:

Effect Description
None No animation; popup appears instantly.
SlideDown Popup slides down smoothly when opening.
ZoomIn Popup zooms in with a scaling effect.
FadeIn Popup fades in gradually when opening.

The following example demonstrates three React Dropdown Menus, each with a different animation effect:

import { enableRipple } from '@syncfusion/ej2-base';
import { DropDownButtonComponent, ItemModel } from '@syncfusion/ej2-react-splitbuttons';
import * as React from 'react';
import * as ReactDom from 'react-dom';

enableRipple(true);

// To render DropDownButton.
function App() {

    let items = [
        { text: 'Unread' },
        { text: 'Has Attachments' },
        { text: 'Categorized' },
        { separator: true },
        { text: 'Important' },
        { text: 'More Filters' }
    ];

    return (
        <div>
            <DropDownButtonComponent
                items={items}
                animationSettings=
            >
                Slide Down
            </DropDownButtonComponent>
            <DropDownButtonComponent
                items={items}
                animationSettings=
            >
                Fade In
            </DropDownButtonComponent>
            <DropDownButtonComponent
                items={items}
                animationSettings=
            >
                Zoom In
            </DropDownButtonComponent>
        </div>
    );
}

export default App;

ReactDom.render(<App />, document.getElementById('button'));
import { enableRipple } from '@syncfusion/ej2-base';
import { DropDownButtonComponent, ItemModel } from '@syncfusion/ej2-react-splitbuttons';
import * as React from 'react';
import * as ReactDom from 'react-dom';

enableRipple(true);

// To render DropDownButton.
function App() {

  let items: ItemModel[] = [
    { text: 'Unread' },
    { text: 'Has Attachments' },
    { text: 'Categorized' },
    { separator: true },
    { text: 'Important' },
    { text: 'More Filters' }
  ];

  return (
    <div>
      <DropDownButtonComponent
        items={items}
        animationSettings=
      >
        Slide Down
      </DropDownButtonComponent>
      <DropDownButtonComponent
        items={items}
        animationSettings=
      >
        Fade In
      </DropDownButtonComponent>
      <DropDownButtonComponent
        items={items}
        animationSettings=
      >
        Zoom In
      </DropDownButtonComponent>
    </div>
  );
}

export default App;

ReactDom.render(<App />, document.getElementById('button'));