component

A reusable, self-contained piece of interface, such as a card or a modal, with its own markup, styles and behaviour.

In more detail

A component bundles markup, styles and behaviour behind a small interface so it can be reused in many places. Keeping components independent of where they are placed makes them easier to test and change.

Examples

In this course: container queries, scoped custom properties and CustomEvents let a component adapt and communicate without depending on page structure.
function StatCard({ title, count }) { return <h3>{title}: {count}</h3>; }

Related terms

Taught in

References