prop
An input passed to a React component, written like an HTML attribute, such as size="lg" in <Button size="lg">.
In more detail
Props flow from parent to child and are read-only inside the child. A component's props are its public API, so design systems design them carefully and keep them stable across versions.
Example
<Box as="button" variant="secondary">Action</Box>Related terms
- React — A JavaScript library for building user interfaces out of components, functions that return a description of what to show.
- boolean prop — A component option that is just true or false, such as isPrimary or hasIcon.
- variant — A named option of a component, such as intent primary or danger and size sm or lg, each mapped to its own styling.
- prop drilling — Passing a value through several layers of components that do not use it, just so a deeply nested one can.
- component — A reusable, self-contained piece of interface, such as a card or a modal, with its own markup, styles and behaviour.
- children prop — The special React prop holding whatever is placed between a component's opening and closing tags.
- immutable — Something that cannot be changed after it is created; to change it you make a new one.
Taught in
- Class Variance Authority: Type-Safe Variant & Prop Orchestration — Design Systems & Component Engineering
- Headless Architecture: State vs Presentation Separation — Design Systems & Component Engineering
- Component API Ergonomics: Composition vs Boolean Config Props — Design Systems & Component Engineering
- Polymorphism & Slotted Composition: The asChild Pattern — Design Systems & Component Engineering
- Storybook & Component Driven Development Workflows — Design Systems & Component Engineering
- 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
- Complex State with useReducer: State Machines And Action Types — React 19 & Modern Component Architecture
- Diffing Algorithm: Element Type Shifts And Subtree Tear Down — React 19 & Modern Component Architecture
- Avoiding Effect Antipatterns: Derived State And Events — React 19 & Modern Component Architecture
- useRef Mechanics: DOM References And Mutable Persistent State — React 19 & Modern Component Architecture
- useImperativeHandle: Controlled Ref Forwarding Boundaries — React 19 & Modern Component Architecture
- Lifting State Up: Colocation, Ownership, And Data Flow — React 19 & Modern Component Architecture
- useContext in Depth: Scoping, Consumer Subscription Costs — React 19 & Modern Component Architecture