Frontendx
README.md
SOLUTION.md
main.tsxentry
App.tsx
App.css
index.html
vite.config.ts
Installed
react@^19.2.0
react-dom@^19.2.0

Preview Selected Color from Swatches

Prompt

Build a color swatch picker where clicking a color swatch instantly updates a preview area (background, text, or product color). Show the selected color name and hex value. Highlight the active swatch with a border.

Store selectedColor in useState. Map swatches array to clickable div elements. On click setSelectedColor(color). Apply selected styling (border
Test Results

Preview Selected Color from Swatches

Build a color swatch picker where clicking a color swatch instantly updates a preview area (background, text, or product color). Show the selected color name and hex value. Highlight the active swatch with a border.