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

# Templates Overview

> Choose the right template for your artifact

Templates define how your artifact content is rendered. Each template accepts specific content fields and produces a distinct visual output.

## Available Templates

<CardGroup cols={2}>
  <Card title="Markdown" icon="file-lines" href="/templates/markdown">
    Rich text documents with full Markdown support
  </Card>

  <Card title="Chart" icon="chart-line" href="/templates/chart">
    Interactive data visualizations
  </Card>

  <Card title="Table" icon="table" href="/templates/table">
    Structured tabular data display
  </Card>

  <Card title="PDF" icon="file-pdf" href="/templates/pdf">
    Generate downloadable PDF documents
  </Card>

  <Card title="Dynamic" icon="cubes" href="/templates/dynamic">
    Build any UI with composable components
  </Card>
</CardGroup>

## Template Comparison

| Template       | Best For                               | Content Type     |
| -------------- | -------------------------------------- | ---------------- |
| `markdown`     | Documentation, reports, formatted text | Markdown string  |
| `chart`        | Data visualization, analytics          | Chart.js config  |
| `table`        | Structured data, lists                 | Rows and columns |
| `pdf`          | Printable documents, exports           | HTML or Markdown |
| `@std/dynamic` | Custom UIs, dashboards, forms          | Component tree   |

## Common Fields

All templates share these optional fields:

<ParamField body="title" type="string">
  Display title shown in the artifact header
</ParamField>

<ParamField body="description" type="string">
  Short description shown below the title
</ParamField>

<ParamField body="expiresIn" type="string">
  Auto-expiration duration (e.g., `1h`, `7d`, `30d`)
</ParamField>

## Example: Choosing a Template

**Scenario**: You want to show quarterly sales data.

* **For a written summary** → Use `markdown`
* **For a bar chart visualization** → Use `chart`
* **For a detailed breakdown by product** → Use `table`
* **For a printable report** → Use `pdf`
* **For a full dashboard with metrics, charts, and tables** → Use `@std/dynamic`

## Template-Specific Content

Each template has its own `content` schema. See the individual template pages for detailed documentation:

* [Markdown Template](/templates/markdown) - Text content with Markdown formatting
* [Chart Template](/templates/chart) - Chart.js configuration object
* [Table Template](/templates/table) - Column definitions and row data
* [PDF Template](/templates/pdf) - HTML or Markdown for PDF generation
* [Dynamic Template](/templates/dynamic) - Composable UI components
