> Documentation index: https://fundchart.io/docs/llms.txt

# Embedding FundChart widgets

The loader, the three elements, every widget type, section keys and every attribute a tag takes.

Add the loader once, then place elements anywhere in your HTML or CMS:

    <script async src="https://embed.fundchart.io/e.js"></script>
    <fundchart-page token="YOUR_TOKEN" fund="FUND_ID" name="your-fund"></fundchart-page>

A working example, the Meridian Asset Management demo (a fictitious workspace):

    <script async src="https://embed.fundchart.io/e.js"></script>
    <fundchart-page token="fcp_c_A6l3U_F6h9DYREV5MyZjNO" fund="14de33c0-e1b7-436e-ad43-7b27f7c1e46b" name="meridian-global-equity-income"></fundchart-page>

`token` is your workspace's public token (`fcp_...`). It is read-only and safe to put in a page. `fund` is the fund's id. Copy both from the fund's page in the FundChart dashboard.

## Elements
- `<fundchart-page>`: the full fund page, drawn from the fund's saved layout (see "What the page fills in by itself" below).
- `<fundchart-widget type="...">`: one widget on its own. `type` defaults to `growth`.
- `<fundchart-center>`: all your published funds as one table. Takes `token` only, no `fund`.

### Widget types
| type | what it draws |
|---|---|
| `facts` | Fund facts grid |
| `hero` | Headline return tile (1 year, else the next period the fund has: year to date, 3, 5 years, since inception) |
| `hero-si` | Headline return tile, since inception |
| `growth` | Growth of an investment, with benchmark and sector lines when the data has them |
| `perf` | Performance bars and the performance table together |
| `perf-chart` | Performance bars only |
| `perf-table` | Performance table only |
| `risk-return` | Risk and return scatter, with its glossary when the data carries one |
| `allocation` | Asset allocation as bars |
| `allocation-donut` | Asset allocation as a pie with its list |
| `allocation-mosaic` | Asset allocation as a mosaic |
| `exposure` | Exposure as bars |
| `exposure-donut` | Exposure as a pie with its list |
| `exposure-longshort` | Net, long and short exposure as a table (funds whose rows carry both legs) |
| `holdings` | Top holdings |
| `monthly` | Monthly returns table |
| `disclaimer` | The regulatory disclaimer |

The image header (`header`) is drawn only inside `<fundchart-page>`. A widget with no data for the fund draws nothing.

### Page sections
`sections` on `<fundchart-page>` takes a comma list of these keys, in the order you want them:

`header`, `facts`, `hero`, `growth`, `perf`, `risk-return`, `allocation`, `exposure`, `holdings`, `monthly`

One key covers its whole family: `perf` is the chart and the table, `allocation` is whichever drawing the fund chose. The standard order is the order above. The regulatory disclaimer is always added, always last, and cannot be removed. Sections with no data hide themselves.

A fund with sections of its own (custom sections: its own words in rows of text, boxes and fact tables, set up with FundChart) has a key per section, `custom:<id>`, for example `custom:key-facts`. The page draws them in the fund's look wherever the list places them. Their words live in the fund's layout, so a bare `<fundchart-page>` carries them; there is no attribute for them.

## Attributes (all optional)

### Look
- `style`: `editorial` (default, the paper look) | `classic` (the factsheet look: flat bars, solid benchmark, no gridlines)
- `theme`: `paper` (light) | `ink` (dark). Editorial defaults to `paper`, Classic to `ink`.
- `brand`: brand colour, hex without `#`. The full palette is derived from it.
- `brand2`: a second brand colour, hex without `#`. Used by `fill="duo"` and by Classic's solid benchmark.
- `fill`: how brand fills are drawn, such as the growth area: `gradient` | `duo` (brand to `brand2`) | `flat`
- `font`: `archivo` | `space-grotesk` | `fraunces` | `plex-mono`
- `background`: `surface` (default, we paint ours) | `card` (sections on cards, your background shows through) | `inherit` (fully transparent)
- `look`: `standard` draws the standard look even when your workspace has a custom look (see below). Any other value is ignored.

Attributes you leave out fall back to the fund's saved layout (pages only), then to your workspace brand in the dashboard (`brand`, `brand2`, `fill`, `font`). An attribute you set always wins.

### Content
- `sections`: page sections to show, see the list above. Pages only.
- `perfRows`: the performance periods to show, comma list, e.g. `1y,3y,5y,si`. Keys: `ytd`, `1y`, `3y`, `5y`, `7y`, `10y`, `si`, `si_cumulative`, `high_1y`, `low_1y`, `avg_1y`, or any period your data names. Works on pages and on the `perf` widgets.
- `perfLabels`: your own wording per period, `key:label` pairs joined by `|`, e.g. `1y:Rolling 12 months|si:Since launch`. Plain text, 60 characters each.
- `showAs`: bars or pie per family on a page, `family:choice` pairs joined by `,`, e.g. `allocation:pie,exposure:bars`. `allocation` takes `bars` | `pie`; `exposure` takes `bars` | `pie` | `table`. For a single widget, pick the `type` instead.

### Image header (pages only)
- `header`: `1` shows the image header band at the top of the page, `0` hides it. Unset, it shows when the layout asks for it, or when there is a header image or an invest link.
- `headerImage`: URL of the photo for the band.
- `headerTitle`: the title in the band (default: the fund's name).
- `investUrl`: the "Invest now" button's link.
- `factsheetUrl`: the factsheet button's link. Without the header, the link sits in the fund facts section.
- `commentaryUrl`: the commentary card's link.
- `tfsaUrl`: the TFSA form's link.

### Other
- `name`: a label for whoever pastes the line (the fund's slug when copied from FundChart), so twenty similar lines can be told apart. The loader ignores it: `fund` picks the fund, so changing `name` changes nothing.
- `link-template` (`<fundchart-center>` only): makes each row a link to your own page, the whole row clickable, e.g. `/funds/{slug}`. A site path, an `https://` address or a same-page `#{slug}` for hash routers.
- `demo-benchmarks`: draws two made-up benchmark lines for demos, on FundChart's own pages only (ignored on any other site). Never real data.
- `primary`: the loader sends it, but the server does not read it. Use `brand`.

`<fundchart-center>` reads the look attributes (`style`, `theme`, `brand`, `brand2`, `fill`, `font`, `background`, `look`) and `link-template`.

## What the page fills in by itself
A bare `<fundchart-page token fund>` draws the page you built in the dashboard. The server reads the fund's saved layout and fills every attribute the line leaves out: look, theme, font, colours, background, sections, periods and their wording, show-as choices, the header and its links. It also uses things you can only set in the dashboard: section headings, header facts and their labels, header headings, extra risk-return definitions, and whether growth is calculated from monthly returns.

Files you host in FundChart fill the links:
- Factsheet: the newest factsheet for the page's month or earlier. A hosted factsheet wins over a link saved in the layout, unless the fund turned hosting off.
- Commentary: the newest commentary file, whatever month the page shows. A commentary from a series also brings its card title and line. A link typed in the layout wins over the hosted file, and words typed in the layout win over the series' words.

An attribute on the line always wins over both. Single widgets follow only the fund's `look` and growth choices from the layout; set their other attributes on the line.

## Custom looks
Enterprise workspaces can have a managed custom look, built and published by FundChart. It restyles every page, widget and the fund centre for that workspace, with no change to the embed line. A fund can opt out with `look="standard"`.

## Updates, caching and errors
- Updates reach embeds within about a minute of publishing. Responses carry `cache-control: public, max-age=60, stale-while-revalidate=300`.
- The loader asks for a narrower layout when the element is under 480px wide, and redraws when it crosses that line.
- A wrong token or fund id, or an unpublished fund, shows a small dashed box saying so.
- A workspace with no active plan gets an empty element that takes no space.
- If your workspace locks embeds to your domains (Settings, API and agents), other sites get the dashed box.

## CMS notes
- Webflow: Embed element, see /docs/embed/webflow.
- WordPress: Custom HTML block inside a full-width Group, see /docs/embed/wordpress. If your editor strips scripts, ask us for the shortcode plugin.
- Squarespace: Code block (Business plan and up).
- React and other frameworks: the elements are standard custom elements.
- The loader script and the elements are the only way to embed. There is no iframe version.
- Staging or self-hosted worker: add `data-api="https://your-worker"` to the script tag.

## See also
- [Public data API](https://fundchart.io/docs/reference/api): the JSON and HTML routes, statuses and caching
- [OpenAPI spec](https://api.fundchart.io/openapi.json)
- [MCP server](https://fundchart.io/docs/reference/mcp): fund data and embed lines for AI agents

---
Source: https://fundchart.io/docs/reference/embedding
Updated: 2026-11-08
