> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentmark.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Components

> Create reusable components to share prompting patterns across your prompts

AgentMark supports reusable components so you can keep prompting patterns consistent across your prompts. Create components in the Dashboard or locally as files. In both cases, a component is an `.mdx`/`.md` file you import into your prompts.

## Create a component

<Tabs>
  <Tab title="Cloud">
    <img src="https://mintcdn.com/puzzlet-9ba7bb98/E5mamgutKtLDWw1H/images/platform/prompt-management/create-component.png?fit=max&auto=format&n=E5mamgutKtLDWw1H&q=85&s=a3bb53d44550ee93f293a4cffb3ed47c" alt="Create component dialog in the Dashboard" className="w-full rounded-xl border border-gray-800 shadow-2xl mb-12" width="380" height="214" data-path="images/platform/prompt-management/create-component.png" />

    The Create Component dialog prompts for the component name and drops a new `.mdx` file into the selected folder. After you edit and publish it, it's available for import in any prompt on this app.

    1. Open the **Files** tab for your app.
    2. Click the kebab menu (⋮) next to the folder where the component should live.
    3. Select **Create Component**, give it a name, and click **Create**.
    4. Edit the component in the visual editor, then click **Publish**.
  </Tab>

  <Tab title="Local">
    Create components as `.mdx` or `.md` files in your `agentmark/` directory:

    ```shell theme={null}
    agentmark/
      ├── components/
      │   ├── math-instructions.mdx
      │   └── language-instructions.md
      └── prompts/
          └── example.prompt.mdx
    ```

    Add a new `.mdx` (or `.md`) file under `components/`. The file is picked up on save. If your app is synced to Cloud, the next `git push` makes it available to your deployed handler; in Local mode, `agentmark dev` reads it directly from disk.
  </Tab>
</Tabs>

## Using components

Import and use components in your prompts:

```jsx example.prompt.mdx theme={null}
import MathInstructions from '../components/math-instructions.mdx';

<System>
  You are a math tutor.
  <MathInstructions level={props.difficulty} />
</System>
```

Component example:

```jsx math-instructions.mdx theme={null}
You are a patient and knowledgeable math tutor.

<If condition={props.level === "basic"}>
  Explain concepts with simple, everyday examples and avoid complex notation.
</If>
<If condition={props.level === "advanced"}>
  Use formal notation, theoretical foundations, and rigorous proofs.
</If>
```

In the calling prompt, the parent passes `level` as a prop; the component reads it as `props.level`. AgentMark scopes component props to the component, so they don't collide with the parent prompt's props. See [TemplateDX Components](/templatedx/components) for the full reference (props, conditional rendering, plain-markdown imports, and composition).

<div className="mt-8 rounded-lg bg-blue-50 p-6 dark:bg-blue-900/30">
  <h3 className="font-semibold mb-3">Have questions?</h3>
  <p className="mb-4">Reach out any time:</p>

  <ul>
    <li>
      Email the team at <a href="mailto:hello@agentmark.co" className="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200">[hello@agentmark.co](mailto:hello@agentmark.co)</a> for support
    </li>

    <li>
      Schedule an <a href="https://cal.com/ryan-randall/enterprise" className="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200">Enterprise Demo</a> to learn about AgentMark's business solutions
    </li>
  </ul>
</div>
