# Dynamic Component

## Overview

Think of the Dynamic Component as a placeholder that displays another Dynamic Component you've already built. It's like having a pre-made section that you can drop into multiple places without rebuilding it each time.

### **Why use it?**

Build once, use everywhere. Create a custom contact list, form section, or mini-dashboard as its own Dynamic Component, then embed it wherever you need it—on different pages or even inside other components.

***

## How to Use It

{% stepper %}
{% step %}

#### Build your reusable component

Create the Dynamic Component you want to reuse (let's call this the "child" component). Add any input variables it needs to receive data from wherever it's placed
{% endstep %}

{% step %}

#### Embed it somewhere else

In your main component (the "parent"), drag a Dynamic Component from the Component Library onto the canvas
{% endstep %}

{% step %}

#### Choose which component to display

In the Properties Panel, select which Dynamic Component you want to show in this spot
{% endstep %}

{% step %}

#### Pass in data

If your child component has input variables, you'll see them listed in the properties. Connect them to the data sources from your parent component
{% endstep %}
{% endstepper %}

***

## Performance Considerations

Keep nesting simple. Avoid components inside components inside components—it gets messy and slow. Pass data between parent and child using input variables rather than making each component fetch its own data separately.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avonnicomponents.com/dynamic-components/components/dynamic-component.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
