Skip to content

Add navigation menu component from Base UI#25

Merged
carlosabadia merged 5 commits intomainfrom
devin/1752485030-navigation-menu
Jul 15, 2025
Merged

Add navigation menu component from Base UI#25
carlosabadia merged 5 commits intomainfrom
devin/1752485030-navigation-menu

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jul 14, 2025

Enhanced Navigation Menu Demo to Match Base UI Example

Summary

This PR enhances the navigation menu component implementation to more closely match the Base UI documentation example. The changes include:

  • Added missing props to NavigationMenuRoot component (delay, close_delay, actions_ref, on_open_change_complete)
  • Updated component descriptions to match Base UI documentation exactly for all sub-components
  • Created comprehensive demo with Overview and Handbook dropdowns containing rich content (titles, descriptions, links)
  • Enhanced styling with better transitions, hover states, and visual feedback
  • Fixed syntax error by changing rx.html to rx.el for HTML elements

The demo now showcases a realistic navigation menu with:

  • Overview dropdown: Quick Start, Accessibility, Releases (2-column grid layout)
  • Handbook dropdown: Styling, Animation (single column layout)
  • GitHub direct link: No dropdown, direct navigation

Review & Testing Checklist for Human

  • Visual positioning of dropdowns: Verify dropdown menus appear correctly positioned and sized when hovering/clicking Overview and Handbook buttons
  • Interactive functionality: Test all click handlers work correctly (Overview links, Handbook links, GitHub link) and show proper toast notifications
  • Styling accuracy: Compare dropdown appearance with Base UI example to ensure visual consistency and proper styling
  • Console error checking: Verify no JavaScript errors appear in browser console during navigation menu interactions
  • Accessibility testing: Test keyboard navigation (Tab, Enter, Escape) and screen reader compatibility

Recommended test plan: Run uv run reflex run in the demo directory, navigate to localhost:3000, and thoroughly test all navigation menu interactions including hover states, click handlers, and visual appearance.


Diagram

%%{ init : { "theme" : "default" }}%%
graph TD
    A["reflex_ui/components/base/navigation_menu.py<br/>NavigationMenu Implementation"]:::major-edit
    B["demo/demo/demo.py<br/>Demo Application"]:::major-edit
    C["reflex_ui/__init__.py<br/>Component Registry"]:::context
    D["Base UI Documentation<br/>@base-ui-components/react"]:::context
    
    A --> B
    C --> A
    D --> A
    
    A --> E["NavigationMenuRoot<br/>Added missing props"]:::minor-edit
    A --> F["Component Descriptions<br/>Updated to match Base UI"]:::minor-edit
    A --> G["ClassNames<br/>Enhanced styling"]:::minor-edit
    
    B --> H["Overview Dropdown<br/>Quick Start, Accessibility, Releases"]:::major-edit
    B --> I["Handbook Dropdown<br/>Styling, Animation"]:::major-edit
    B --> J["GitHub Link<br/>Direct navigation"]:::major-edit
    
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit
        L3[Context/No Edit]:::context
    end
    
    classDef major-edit fill:#90EE90
    classDef minor-edit fill:#87CEEB
    classDef context fill:#FFFFFF
Loading

Notes

  • The dropdown content showed as "offscreen" in HTML during testing, which may indicate positioning issues that need visual verification
  • All pre-commit checks passed (ruff, codespell, pyright)
  • This implementation maintains the existing granular API structure without adding a high-level component (per user request)
  • Session URL: https://app.devin.ai/sessions/013efce6ad5445ef9f2e759a8a698c57
  • Requested by: Carlos Cutillas (carlos@reflex.dev)

Demo Screenshot

- Implement NavigationMenuBaseComponent extending BaseUIComponent
- Add all navigation menu sub-components following existing patterns
- Create HighLevelNavigationMenu wrapper for simple usage
- Add to lazy loading system in __init__.py
- Include example in demo application
- Component renders and functions correctly with clickable buttons

Co-Authored-By: Carlos Cutillas <carlos@reflex.dev>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 4 commits July 14, 2025 09:38
…lar API

- Removed HighLevelNavigationMenu class as requested
- Updated demo to use ui.navigation_menu.root(), ui.navigation_menu.list(), etc.
- Removed unused imports (foreach, button)
- Fixed linting issues

Co-Authored-By: Carlos Cutillas <carlos@reflex.dev>
- Add missing props to NavigationMenuRoot (delay, close_delay, actions_ref, on_open_change_complete)
- Update all component prop descriptions to match Base UI documentation exactly
- Create comprehensive demo with Overview and Handbook dropdowns
- Add rich content with links, titles, and descriptions
- Update ClassNames for better styling and transitions
- Include Portal structure for proper positioning
- Fix syntax error: use rx.el instead of rx.html for HTML elements

Co-Authored-By: Carlos Cutillas <carlos@reflex.dev>
@carlosabadia carlosabadia merged commit 1e04e20 into main Jul 15, 2025
1 check passed
@carlosabadia carlosabadia deleted the devin/1752485030-navigation-menu branch July 15, 2025 09:26
carlosabadia added a commit that referenced this pull request Jul 15, 2025
* Add navigation menu component from Base UI

- Implement NavigationMenuBaseComponent extending BaseUIComponent
- Add all navigation menu sub-components following existing patterns
- Create HighLevelNavigationMenu wrapper for simple usage
- Add to lazy loading system in __init__.py
- Include example in demo application
- Component renders and functions correctly with clickable buttons

Co-Authored-By: Carlos Cutillas <carlos@reflex.dev>

* Remove HighLevelNavigationMenu component and update demo to use granular API

- Removed HighLevelNavigationMenu class as requested
- Updated demo to use ui.navigation_menu.root(), ui.navigation_menu.list(), etc.
- Removed unused imports (foreach, button)
- Fixed linting issues

Co-Authored-By: Carlos Cutillas <carlos@reflex.dev>

* Enhance navigation menu demo to match Base UI example

- Add missing props to NavigationMenuRoot (delay, close_delay, actions_ref, on_open_change_complete)
- Update all component prop descriptions to match Base UI documentation exactly
- Create comprehensive demo with Overview and Handbook dropdowns
- Add rich content with links, titles, and descriptions
- Update ClassNames for better styling and transitions
- Include Portal structure for proper positioning
- Fix syntax error: use rx.el instead of rx.html for HTML elements

Co-Authored-By: Carlos Cutillas <carlos@reflex.dev>

* fixes

* comment pre

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Carlos Cutillas <carlos@reflex.dev>
Co-authored-by: carlosabadia <cutillascarlos@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant