Noora.Dropdown (noora v0.3.1)

Renders a customizable dropdown component with a trigger, menu, and item options, supporting icons, labels, and event handling.

Example

<.dropdown id="menu" label="Options">
  <.dropdown_item label="Edit" navigate="/edit" />
  <.dropdown_item label="Delete" on_click="delete" />
</.dropdown>

Summary

Functions

inline_dropdown(assigns)

Attributes

  • id (:string) (required) - Unique identifier for the dropdown component.
  • label (:string) - Main text displayed in the dropdown trigger. Defaults to nil.
  • disabled (:boolean) - Whether the dropdown is disabled. Defaults to nil.
  • on_open_change (:string) - Event handler for when the dropdown opens. Defaults to nil.
  • on_highlight_change (:string) - Event handler for when the highlighted option changes. Defaults to nil.
  • on_select (:string) - Event handler for when an option is selected. Defaults to nil.
  • on_escape_key_down (:string) - Event handler for when the escape key is pressed. Defaults to nil.
  • on_pointer_down_outside (:string) - Event handler for when the pointer is pressed outside the dropdown. Defaults to nil.
  • on_focus_outside (:string) - Function called when the focus is moved outside the component. Defaults to nil.
  • on_interact_outside (:string) - Function called when an interaction happens outside the component. Defaults to nil.

Slots

  • inner_block - Content to be rendered inside the dropdown menu.