How pstachula-dev/react-micro-carousel works
Main Components Structure
a. Core Components
b. Hooks & Logic
c. Services & Utilities
Component Layer (Top Section)
• CarouselProvider (Top-level)
• Carousel
• Slide
• DotsGroup
• Dot
• NextButton
• PrevButton
• Counter
State Management & Context Layer (Middle Section)
• CarouselContext
• useCarouselReducer
Hooks Layer (Middle-Right Section)
Custom hooks:
• Custom Hooks
• useAutoplay
• useMergeConfig
• useIntersectionObserver
• useResizeObserver
Services Layer (Bottom Section)
Utility services:
• Services
• CarouselError
• Event Management
• Slider Calculations
• Type Definitions
Special Notations
• Lazy-loading capability
• Touch/mouse event handlers
• Tailwind CSS integration points
Important Features to Highlight
• Zero dependencies architecture
• Typescript support
• Lazy loading mechanism
• Touch/mouse event handling
• Responsive design support
Implementation Details
• Configuration flow from CarouselProvider
• Event propagation paths
• Intersection observer connections
• Resize observer integration
Key Considerations:
Demonstrate how lazy loading is implemented
Additional Notes:
• Package size information (2.6kB JS, 1.5kB CSS)
• Tailwind CSS integration points
• TypeScript type definitions flow