Dropdown - Keep React

The Dropdown Component is a versatile user interface element that provides users with a menu of selectable options. With a wide range of customization options, including labels, icons, search bars, checkboxes, and more, the Dropdown Component enhances user interaction by offering intuitive and flexible selection functionalities.

Table of Contents#

Default Dropdown#

The Default Dropdown represents a list of items as dropdown items with <DropdownItem> components.

The Dropdown with Icon component allows you to include icons within dropdown items.

The Dropdown with submenu component allows you to include submenu within dropdown items.

The Dropdown component allows you to include checkbox within dropdown items.

The Dropdown component allows you to include radio button within dropdown items.

API Reference#

Here is a list of the props that you can pass to the dropdown component:

PropertyDescriptionTypeDefault
defaultOpenDefault open state of the dropdown menu.booleanfalse
openThe controlled open state of the dropdown menubooleanfalse
onOpenChangeEvent handler called when the open state of the dropdown menu changes.function(open: boolean) => void
modalThe modality of the dropdown menu.booleanfalse

Content API Reference#

Here is a list of the props that you can pass to the dropdown content component:

PropertyDescriptionTypeDefault
sideThe preferred side of the trigger to render against when open
top
right
bottom
left
bottom
sideOffsetThe distance in pixels from the trigger.number0
alignThe preferred alignment against the trigger.
start
center
end
center

Reference#

Our dropdown component is built using the @radix-ui/react-dropdown-menu package. For more information , follow the documentation @radix-ui/react-dropdown-menu.