Build a Resizable Multi-Panel Layout Component
In modern e-commerce platforms like Meesho, complex dashboards and developer consoles are crucial for monitoring various business metrics, managing orders, or debugging applications. These interfaces often require flexible layouts to display multiple types of content side-by-side or top-bottom, allowing users to customize their workspace. This problem focuses on building a core UI primitive: a resizable panel component.
Your task is to create a ResizablePanels React component that can display two child components (panels) separated by a draggable divider. Users should be able to resize these panels by dragging the divider.
ResizablePanels.ResizablePanels component should accept two ReactNode children as props, representing the content for the left/top and right/bottom panels.ResizablePanels should display two panels horizontally (side-by-side), with the divider in the middle.ew-resize when hovered over.ResizablePanels component renders two distinct child panels and a visible divider between them.ew-resize.Constraints
react-resizable-panels, react-split) are allowed. Implement the core resizing logic yourself using native browser events.ResizablePanels component will be rendered within a parent container that provides sufficient space (e.g., width: 100%; height: 400px;).localStorage).useState, useRef, and useEffect for managing component state and side effects.Loading editor...