Overview
Clevertap's campaign creation often involves editing content (e.g., email templates, push notifications) and seeing a live preview. A flexible UI that allows users to adjust the working area to their preference is crucial for productivity. This problem asks you to build a foundational component for such an experience: a horizontally split pane where the user can drag a divider to resize the editor and preview areas.
What you need to do / Task
Your goal is to implement a resizable split pane component for a simple content editor and live preview.
- Render Panes: Display two distinct content areas: a "Content Editor" on the left and a "Live Preview" on the right.
- Implement Draggable Divider: Create a vertical divider element positioned between the two panes.
- Resize Panes: When the divider is dragged horizontally by the user, the widths of the "Content Editor" and "Live Preview" panes should adjust dynamically.
- Fill Container: Ensure the combined width of the two panes and the divider always occupies 100% of the available width of their parent container.
UI/UX expectations
- Initial State: The "Content Editor" and "Live Preview" panes should initially render with equal widths (e.g., 50% each, accounting for the divider's width).
- Divider Visuals: The divider should be visually distinct (e.g., a thin vertical bar with a background color).
- Cursor Feedback: When the user hovers over the divider, the cursor should change to
ew-resize to indicate it is draggable.
- Smooth Resizing: Dragging the divider should result in smooth, real-time resizing of the adjacent panes.
- Minimum Width: Panes should not be allowed to collapse to zero width. Implement a reasonable minimum width (e.g., 100px) for each pane.
Acceptance criteria
- The application renders two distinct content panes and a vertical divider between them.
- The divider is visually distinct and has the
ew-resize cursor on hover.
- Dragging the divider horizontally successfully resizes both the left and right panes.
- Panes maintain a minimum width and do not collapse completely.
- The combined width of the two panes and the divider always fills the parent container's width.
- The component behaves responsively to mouse drag events (i.e., resizing is smooth and real-time).