eds-dropdown

Explore the Interactive Component

Use the playground below to experiment with the component. Click the button to view the full Storybook deployment for additional examples and configurations.

See It in Use with Code

Check out this practical implementation of component.

In React

Overview

EdsDropdown is a versatile dropdown component that provides a list of items that appear upon clicking the dropdown button. It supports various customization options, such as positioning, styling, and keyboard accessibility.

Key features include:

  • Configurable dropdown position (left or right) and offset.
  • Customizable intent styles (e.g., primary, secondary).
  • Keyboard navigation with support for up and down arrow keys.
  • Option to use as a navigation menu or standard dropdown.

This component is well-suited for use in menus, navigational elements, and other interactive UI patterns.

Properties

PropertyAttributeDescriptionTypeDefault
ariaLabelaria-labelAccessible label for the dropdown button.string'Open dropdown'
asNavas-navSpecifies whether the dropdown acts as a navigation menu.booleantrue
dropdownOffsetdropdown-offsetOffset spacing for the dropdown relative to the button.booleantrue
dropdownPosdropdown-posPosition of the dropdown relative to the button."left" | "right"'left'
iconiconIcon displayed on the dropdown button.string'chevron-down'
intentintentVisual intent of the dropdown button. Options include: ‘primary’, ‘secondary’, ’tertiary’, ‘ghost’, ‘ghostInverse’."ghost" | "ghostInverse" | "primary" | "secondary" | "tertiary"'tertiary'
labellabelLabel for the dropdown button.stringundefined
roundedroundedWhether the dropdown button has rounded (pill) styling.booleanfalse

Events

EventDescriptionType
dropdownEvent emitted when the dropdown toggles, indicating the new expanded/collapsed stateCustomEvent<{ expanded: boolean; }>

Dependencies

Used by

Depends on

Graph

eds-dropdown
eds-button
eds-icon-wrapper
eds-user

Built with StencilJS

Last updated on