Overview
Myntra's team of stylists constantly curates unique outfits and collections. Before an outfit is published, they need an an intuitive way to arrange the items within it, ensuring the visual flow and prominence of key pieces are just right. This problem focuses on building a core UI component for reordering items within a curated outfit.
What you need to do / Task
Your primary task is to implement a drag-and-drop interface for reordering a list of outfit items. Specifically, you need to:
- Display a pre-defined list of outfit items.
- Enable users to drag any item from the list and drop it into a new position within the same list.
- Ensure the internal state of the component accurately reflects the new order after a successful drag-and-drop operation.
UI/UX expectations
- Item Representation: Each outfit item should be clearly distinguishable, displaying at least its name and a placeholder for an image.
- Visual Feedback: Provide clear visual cues during the drag operation. The item being dragged should have a distinct appearance (e.g., a different background or border), and the potential drop target (where the item will land) should be visually indicated as the dragged item hovers over other items.
- Smooth Interaction: The reordering process should feel smooth and responsive.
- Basic Layout: The list of items should be vertically stacked with reasonable spacing.
Acceptance criteria
- The initial list of
OutfitItem components is rendered correctly based on the mock data.
- A user can successfully initiate a drag operation on any item in the list.
- As an item is dragged over other items, the list visually rearranges to indicate the prospective drop position.
- Releasing the dragged item updates its position permanently within the displayed list.
- The order of items, once changed by a drag-and-drop operation, persists within the component's state.