Documentation
Components
Dropdown

Dropdown

The Dropdown component is a versatile UI element that allows users to select an option from a list of choices. It's commonly used in forms, navigation menus, and other interactive interfaces.

Installation

Install the package

npm i @start-base/start-ui

Add the styles

To use the React form elements styles in a Next.js project, import the styles in your layout.tsx file.

app/layout.tsx
import "@start-base/start-ui/styles.css";

Import the component

import Dropdown from '@start-base/start-ui/Dropdown';
import FloatingMenuItem from '@start-base/start-ui/FloatingMenuItem';
import Button from '@start-base/start-ui/Button';

Usages

API

NameTypeDefaultDescription
childrenReactElement[]Child elements of the dropdown
componentReactElementComponent to trigger the dropdown
labelstringLabel for nested dropdown items
classNamestringCSS class for the dropdown container
menuClassNamestringCSS class for the dropdown menu
onFocusfunctionCallback function when dropdown gains focus
placementstringPositioning of the dropdown menu. Variants: top, bottom, left, right, top-start, top-end, bottom-start, bottom-end, left-start, left-end, right-start, right-end