🌐UI Component
Also known as Component, Front-End Component, React Component
A small part of a page, like a button or card. You can use it again.
Think of it like
Think of it like a toy brick. You snap small bricks together to build a whole castle.
Example
Emma makes a ProductCard component once. Her shop page shows 40 of them, each with a different name and price.
Why it matters
Components let you build once and reuse. A fix in one place fixes every copy.
Definition
Example code
jsx
function Greeting({ name }) {
return <p>Hi {name}</p>;
}Common mistake
Key takeaways
- 1Small and reusable. Build once, use many times.
- 2Holds its own parts. Look, data and behaviour.
- 3Nests inside others. Pages are built from them.