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
- widget — A self-contained interactive piece of an interface, such as a tab panel, date picker or accordion.
- container query — A CSS rule, written with @container, that styles a component based on the size of its container instead of the whole viewport.
- CustomEvent — A browser event type you create and name yourself, which carries any data you like in its detail property.
- props — The inputs passed to a component, written like HTML attributes, such as <Avatar size={48} />.
- React Server Components — React components that run only on the server, sending their rendered result to the browser without shipping their code.
- Client Component — A component whose code is also sent to the browser so it can use state, effects and event handlers.
- component tree — The nested structure of components that make up a page, from the root layout down to the smallest button.
- prop — An input passed to a React component, written like an HTML attribute, such as size="lg" in <Button size="lg">.
- React element — A plain, read-only JavaScript object describing one piece of UI: its type, its props and an optional key.
- class component — The older way to write a React component, as a JavaScript class with a render method and lifecycle methods.
- component state — Data a component remembers between renders, such as typed text or whether a menu is open; changing it makes React render again.
Taught in
- DOM Manipulation: DocumentFragment And HTML Templates — Frontend Architecture & Web Platform
- Container Queries: Component-Driven Responsive Design — Frontend Architecture & Web Platform
- CustomEvent Dispatching And Decoupled Component Event Buses — Frontend Architecture & Web Platform
- App Router Architecture: Server-First Paradigms — Next.js 15 & Modern App Router Architecture
- Server Components: Async Execution & Constraints — Next.js 15 & Modern App Router Architecture
- Client Components: use client & Hydration Models — Next.js 15 & Modern App Router Architecture
- Component Tree Composition: Interleaving RSC & Client — Next.js 15 & Modern App Router Architecture
- Serialization Boundaries: Props & Server Guardrails — Next.js 15 & Modern App Router Architecture
- Templates vs Layouts: Remounting & Page Transitions — Next.js 15 & Modern App Router Architecture
- JSX Transpilation: createElement, JSX Runtime, React Elements — React 19 & Modern Component Architecture
- Component Purity: Pure Functions, Idempotence And Side Effects — React 19 & Modern Component Architecture
- Props Contract: Immutability, Children, And Polymorphic Tags — React 19 & Modern Component Architecture
- State with useState: Immutability And Asynchronous Batching — React 19 & Modern Component Architecture
- Complex State with useReducer: State Machines And Action Types — React 19 & Modern Component Architecture
- Virtual DOM vs Real DOM: The Reconciliation Cost Model — React 19 & Modern Component Architecture
- Keys In Depth: Identity Preservation And Identity Resetting — React 19 & Modern Component Architecture
- Diffing Algorithm: Element Type Shifts And Subtree Tear Down — React 19 & Modern Component Architecture
- SyntheticEvent System: Event Delegation in Modern React — React 19 & Modern Component Architecture
- useEffect Lifecycle: Mount, Dependencies, And Cleanup Phases — React 19 & Modern Component Architecture