children prop

The special React prop holding whatever is placed between a component's opening and closing tags.

In more detail

<Card><CardTitle /></Card> passes the CardTitle element as Card's children. Accepting children lets consumers decide the content and order, which is the simplest form of composition.

Examples

<Modal><OrderList /></Modal>  // OrderList stays a Server Component
<Card title="News"><p>Body text</p></Card>

Related terms

Taught in

References