Skip to content

Dropdown

The Dropdown component provides interactive dropdown menus that can be triggered by buttons or links. It supports various positioning options and can contain custom content or navigation items.

PropTypeValuesDescription
posstringleft/right/centerPosition of the dropdown content relative to the trigger.
titlestring-Title text for the dropdown button.
itemsarrayhref, title, targetArray of navigation items for DropdownNav and DropdownMenu components.
classNamestring-Additional CSS classes for custom styling.
tagstringbutton/a/liHTML tag to use for the dropdown trigger element.

The Dropdown component utilizes the following CSS variables for customization:

--dropdown-bg: #ffffff; /* Background color of the dropdown content. */
--dropdown-border: rgba(0, 0, 0, 0.1); /* Border color of the dropdown content. */
--dropdown-border-radius: 5px; /* Border radius of the dropdown content. */
--dropdown-padding: 10px; /* Padding inside the dropdown content. */
--dropdown-margin-top: 10px; /* Margin top of the dropdown content. */
--dropdown-nav-width: 200px; /* Width of the dropdown navigation. */
--dropdown-nav-item-color: #231818; /* Text color of navigation items. */
--dropdown-nav-item-hover-bg: #f5f5f5; /* Background color on hover for navigation items. */
--dropdown-nav-item-padding: 5px 12px; /* Padding for navigation items. */