A component is a self-contained, reusable piece of user interface — a button, card, navigation bar, or form. Modern UI development builds pages by composing smaller components together like building blocks. AI generates components fluently, making them the fundamental unit of vibe-coded frontend development.
Components are the LEGO bricks of modern web development. Every page you see is built from smaller, reusable pieces snapped together.
Without components, you'd copy-paste the same HTML for every button, card, and form on your site. With components:
function ProductCard({ name, price, image }) {
return (
<div className="card">
<img src={image} alt={name} />
<h3>{name}</h3>
<p>${price}</p>
<button>Add to Cart</button>
</div>
)
}
A component is just a function that returns UI.
Pages are built by nesting components:
Page
├── Header
│ ├── Logo
│ ├── Navigation
│ └── UserMenu
├── ProductGrid
│ ├── ProductCard
│ ├── ProductCard
│ └── ProductCard
└── Footer
Components are AI's bread and butter. Effective prompts:
AI generates clean, reusable components — your job is describing what you need and reviewing the output.