Examples
- Basic Usage
- Custom Sizing

Simple dropdown menu with action items triggered by a button.
Properties
Required
Whether the dropdown menu is currently visible. Control this with state management to show/hide the menu.
Callback function called when the menu’s visibility changes. Use this to update your state when the menu is dismissed by clicking outside.
A list of sections containing the menu items. Each section groups related actions together.
The widget that triggers the dropdown menu. Can be any widget, but typically a button or clickable element.
Layout
Fixed width for the dropdown menu. If not provided, the menu will size itself to fit the content.
Whether the dropdown should match the width of the trigger widget.
Whether the dropdown should have a maximum height with scrolling for large lists.
Section Properties
TheNeoDropdownMenuSection
class represents grouped sections within the dropdown:
Required
A list of menu items within this section.
Content
The section header text. If not provided, the section will not display a header.
Layout
Whether to show a divider line between this and other sections.
Item Properties
TheNeoDropdownMenuItem
class represents individual actionable menu items:
Required
The text displayed for the menu item.
Callback function executed when the item is tapped.
Content
An optional icon to display before the label.
Styling
Whether the item represents a destructive action. When true, the item appears with danger styling (typically red).
Best Practices
- State Management: The menu doesn’t close automatically when items are tapped, giving you control over when to dismiss it. Typically, you’ll want to close the menu (
isOpen = false
) in itemonTap
callbacks, but you can choose to do this before or after executing your action depending on your needs. - Destructive Actions: Use
isDanger: true
for destructive actions like delete, remove, or clear operations.
Integration Notes
- Auto Dismiss: The menu automatically closes when clicking outside the dropdown area.
- Positioning: The menu intelligently positions itself relative to the trigger to stay within screen bounds.