slot
A place in a component's layout that the consumer fills with their own content, either through a named prop such as icon or through a Slot component.
In more detail
Named slot props like leadingIcon or trailingAction give structure to layouts with fixed zones, such as a dialog header and footer. Radix's Slot component is a different use of the word: it merges a component's props onto its single child element, which powers the asChild pattern.
Example
<Layout top={<h1>App</h1>} main={<p>Content</p>} />Related terms
- composition — Building a component out of smaller components that the consumer assembles, instead of configuring one big component with flags.
- asChild — A prop that tells a component to render its single child element instead of its own, merging its classes, props and behaviour onto that child.
- children prop — The special React prop holding whatever is placed between a component's opening and closing tags.
- inversion of control — A design in which a piece of code gives up control of some decisions, such as how its dependencies are created or what it renders, to the code around it.
- headless component — A component that provides behaviour, state and accessibility but no styling, leaving the look entirely to the consumer.
Taught in
- Component API Ergonomics: Composition vs Boolean Config Props — Design Systems & Component Engineering
- Polymorphism & Slotted Composition: The asChild Pattern — Design Systems & Component Engineering
- Props Contract: Immutability, Children, And Polymorphic Tags — React 19 & Modern Component Architecture
- Lifting State Up: Colocation, Ownership, And Data Flow — React 19 & Modern Component Architecture
- Higher-Order Components And Render Props: Tradeoff Analysis — React 19 & Modern Component Architecture
- Slot Patterns And Headless UI Architecture in React — React 19 & Modern Component Architecture
- Rules of Hooks: Call Order, Hook Lists, And Fiber Storage — React 19 & Modern Component Architecture
- The React Compiler: Automated Memoization Under The Hood — React 19 & Modern Component Architecture