Skip to content
BENIBIX Learn

UI Component

Development🌐 Web DevelopmentFrameworks

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

A component is a small piece of a user interface that you can use again. A button, a card or a menu can each be one. Each one holds its own look, its own data and what it does. You build a page by putting components inside other components. The same component can be used in many places with different inputs. Most new front-end frameworks are built around them.

Example code

jsx
function Greeting({ name }) {
  return <p>Hi {name}</p>;
}
A tiny component that says hi to the name it is given.

Common mistake

Making one huge component that does everything. Split it into small parts that each do one job.

Key takeaways

  1. 1
    Small and reusable. Build once, use many times.
  2. 2
    Holds its own parts. Look, data and behaviour.
  3. 3
    Nests inside others. Pages are built from them.