Skip to main content

Dropdown

shadow

Dropdown element is used to display the context menu after clicking the button. Allows the user to select one of the predefined options. It contains a Button element that acts as an activator and a Menu element with content in the form of individual MenuItem. items.

Basic usage

Display on hover

When to use

Use wje-dropdown to communicate status, result of actions, or required next steps immediately.

When not to use

Do not show multiple feedback channels for the same event unless there is a strong reason.

Accessibility

Announce status updates with suitable ARIA live regions and manage focus for modal interactions.

Best Practices

  • Match message severity (info/success/warning/error) to actual user impact.
  • Use confirmations only for destructive or hard-to-reverse actions.
  • Keep timeouts consistent so users have enough time to read messages.

Attributes and Properties

active

DescriptionControls whether the dropdown is currently open.
Attributeactive
Typeany
Default-

Events

NameDescription
wje-dropdown:openEvent fired when the dropdown is opened.
wje-dropdown:closeEvent fired when the dropdown is closed.

Methods

beforeShow

DescriptionRuns before the component is shown so pre-display setup can be applied.
Signature() => any

afterShow

DescriptionThis method is called after the dropdown is shown.
Signature() => void

CSS Shadow Parts

NameDescription
nativeThe native part of the dropdown.

CSS Custom Properties

No CSS custom properties available for this component.

Slots

NameDescription
triggerThe slot for the trigger of the dropdown.
defaultThe default slot for the dropdown.