Skip to content

Add Base UI accordion component with high-level wrapper#36

Merged
carlosabadia merged 2 commits intomainfrom
devin/1753889316-accordion-component
Jul 31, 2025
Merged

Add Base UI accordion component with high-level wrapper#36
carlosabadia merged 2 commits intomainfrom
devin/1753889316-accordion-component

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

Add Base UI accordion component with high-level wrapper

Summary

This PR implements a complete Base UI accordion component wrapper for reflex-ui, following the established patterns used by other components like tooltip and select. The implementation includes:

  • Individual components: AccordionRoot, AccordionItem, AccordionHeader, AccordionTrigger, AccordionPanel
  • High-level wrapper: HighLevelAccordion that accepts trigger and content props as requested
  • Component namespace: Both compositional API (accordion.root(), accordion.item()) and high-level API (accordion())
  • Base UI integration: Proper library configuration with @base_ui/react/accordion
  • Lazy loading: Added to the reflex-ui lazy loader system
  • Demo integration: Added accordion example to demo app

The component was tested locally and confirmed to work with proper expand/collapse functionality.

Review & Testing Checklist for Human

  • Verify accordion animations work correctly - Test that expand/collapse transitions are smooth and follow the expected Base UI behavior
  • Test high-level API with different content types - Try passing both string and component content to ensure flexibility
  • Check component styling matches design system - Verify the Tailwind classes produce the expected accordion appearance
  • Test compositional API - Ensure accordion.root(), accordion.item(), etc. work for advanced use cases
  • Verify multiple accordions work - Test rendering multiple accordion instances on the same page

Recommended test plan: Run the demo app, interact with the accordion, try creating custom accordion layouts using both high-level and compositional APIs.


Diagram

%%{ init : { "theme" : "default" }}%%
graph TD
    A["reflex_ui/__init__.py"]:::major-edit --> B["components/base/accordion.py"]:::major-edit
    A --> C["components/base/tooltip.py"]:::context
    B --> D["Base UI accordion library"]:::context
    B --> E["BaseUIComponent"]:::context
    F["demo/demo/demo.py"]:::minor-edit --> A
    G["Browser Test"]:::context --> F
    
    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

  • Prop descriptions: Sourced from Base UI JSON documentation files for accuracy
  • CSS classes: Follow existing patterns from tooltip/select components but may need refinement for optimal accordion styling
  • Testing: Basic functionality verified in browser, but edge cases and styling details need human verification
  • API design: High-level wrapper follows the same pattern as HighLevelCollapsible for consistency

Session requested by: Carlos Cutillas (carlos@reflex.dev)
Link to Devin run: https://app.devin.ai/sessions/e21529f7d4eb4e66bd03e34ad963fbe4

Accordion working in demo

- Create accordion component following established reflex-ui patterns
- Implement AccordionRoot, AccordionItem, AccordionHeader, AccordionTrigger, AccordionPanel components
- Add HighLevelAccordion wrapper with trigger and content props as requested
- Follow BaseUIComponent pattern with proper Base UI integration
- Add component to lazy loader system in __init__.py
- Add accordion example to demo application
- All prop descriptions sourced from Base UI documentation JSON files
- Component tested and working correctly with expand/collapse functionality

Co-Authored-By: Carlos Cutillas <carlos@reflex.dev>
@devin-ai-integration
Copy link
Copy Markdown
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

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@carlosabadia carlosabadia merged commit faca182 into main Jul 31, 2025
4 checks passed
@carlosabadia carlosabadia deleted the devin/1753889316-accordion-component branch July 31, 2025 09:26
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