Skip to main content

React Components

Components are the unit of reuse. Get the abstraction boundary wrong and you carry the cost in every file that imports it.

Aim to use Component Driven Development — build components in isolation, compose in context.

Five Dimensions

DimensionQuestion
StructureHow does it compose?
AestheticsDoes it follow the design system?
VarianceHow many states does it handle?
WordsDoes the copy do the work?
MotionDoes animation serve function?

Dig Deeper

  • Hooks — State, effects, refs, memoization — React's core primitives
  • Concepts — Server components, motion, animation patterns
  • Libraries — shadcn, dApp dev kits, component ecosystems
  • Feature Components — Maps, charts, calendars, tables, SVGs
  • Browser APIs — Web platform capabilities beyond React
  • Browser Maps APIs — Map library selection and integration

Context

Questions

When does a component earn its own abstraction versus staying inline?

  • How do you decide between a headless component library and a styled one?
  • What signals tell you a component is doing too much?
  • When should a feature component live in a shared library versus the consuming app?