2022-03-31
Hello developer!, glad to see you again.
This is a react-curve, open source project where I can share and start creating small UI components in the way I understood the concepts to build large scale projects .
This week we created a colors app that displays the list of the colors in react.
To create a color component; We have to :
import React from 'react';
const DisplayColors = () => {
const colors = [
{id: 1, name: 'brown', hex: '#A52A2A'},
{id: 2, name: 'crimson', hex: '#DC143C'},
{id: 3, name: 'red', hex: '#FF0000'},
]
const colorItems = colors.map(color =>
<li key={color.id} id="currColor">
{color.id} | {color.name} | {color.hex}
</li>)
return (
<div className="displayColors">
<h2>Display Colors</h2>
<div>
{colorItems}
</div>
</div>
);
}
export default DisplayColors;
Thank you for reading and any contribution is more than welcome in the threads below!