Components
Dropdown Menus
Gopx Dropdown

Gopx Dropdown

Beautifully designed dropdown menu components for GOPX WEBUI (opens in a new tab) with Tailwind CSS and Framer Motion. Copy, paste, and customize to enhance your web projects effortlessly.

Dropdown Menus GOPX Animated framer-motion

Installation

Run the following command:

npx gopx-webui add dropdown

Props

DropdownButton

PropTypeRequiredDescription
valuestring | numberYesThe current value displayed in the dropdown button. If no value is set, the placeholder will be shown.
placeholderstringYesThe placeholder text displayed when there is no value.
onClickfunctionYesA function that is called when the button is clicked.
isOpenbooleanYesA flag indicating whether the dropdown is currently open or closed.

DropdownItem

PropTypeRequiredDescription
optionTYesThe option object that represents the dropdown item.
onClickfunctionYesA function that is called when the dropdown item is clicked.
childrenReact.ReactNodeYesThe content to be displayed inside the dropdown item.

DropdownMenu

PropTypeRequiredDescription
childrenReact.ReactNodeYesThe content to be displayed inside the dropdown menu. This can include any valid React nodes, such as DropdownItem components or other elements.

Dropdown

PropTypeRequiredDescription
valueTYesThe currently selected value of the dropdown. This should match one of the options in the options array.
onChange(value: T) => voidYesA function that is called when an option is selected. It receives the selected value as an argument.
optionsT[]YesAn array of options available for selection in the dropdown.
renderOption(option: T) => React.ReactNodeNoAn optional function that allows for custom rendering of each dropdown option. If not provided, the option will be displayed as is.
placeholderstringNoAn optional placeholder text displayed when no option is selected. Defaults to "Select an option".
classNamestringNoAn optional additional CSS class for styling the dropdown component.