Skip to main content

Dropdown

When you need the dropdown menu, you can use it simply by giving the items.

Example Usage

import { Dropdown } from "react-chat-elements";
<Dropdown
title="Dropdown Title"
animationType="default"
animationPosition="southeast"
buttonProps={{
text: "Electronic",
}}
onSelect={(e) => {
console.log(e);
}}
items={[
{
text: "Computers",
icon: {
float: "right",
color: "blue",
size: 10,
component: <IconExample />,
},
},
{
text: "Phones",
},
]}
/>;

Result

propdefaulttypedescription
animationTypenonestringfade or default
animationPositionnortweststringanimation start position (nortwest, norteast, southwest, southeast)
itemsnonearraydropdown items array (see details below)
onSelectnonefunctionitem on select
buttonPropsnoneobjectbutton properties
classNamenonestringclassName for optional Dropdown
titlenonestringDropdown menu title
About Dropdown Items

Dropdown Items can be define as just string array --> ["dropdown","items","example"]

On the other hand it can also be define as object array that contains belows props.

propdefaulttypedescription
textnonestringdropdown item text
iconnoneobjectdropdown item icon (see details below)
propdefaulttypedescription
floatnonestringicon style float
colornonestringicon color
size12numberfont size
classNamenonestringclassName for optional icon
componentnoneReactChildicon component