<!-- https://svgrid.com/docs/recipes/theme-matched-export/ - SvGrid documentation as markdown. Index of every page: https://svgrid.com/llms.txt -->

# Theme-matched xlsx export

> Live in [demo 56-export-theme-matched](https://svgrid.com/demos/56-export-theme-matched/).

> Live demo: Export - Theme-matched - https://svgrid.com/demos/56-export-theme-matched/

## When

Excel file colours follow the same --sg-* tokens the grid renders with.

## How

Key API surface:

- `api.exportData({ format: 'xlsx', styles: { ... } })`

See the demo source for the full implementation; this recipe pins the
pattern + the surface so you can copy-paste it confidently. The doc
page that explains the underlying feature in depth is linked from the
[recipes index](https://github.com/sv-grid/sv-grid/blob/main/docs/recipes/index.md).

## See also

- [Demo 56-export-theme-matched source](https://github.com/sv-grid/sv-grid/blob/main/examples/src/demos/56-export-theme-matched.svelte)
- [Demo 56-export-theme-matched prompt sidecar](https://github.com/sv-grid/sv-grid/blob/main/examples/src/demos/prompts/56-export-theme-matched.md) - drop into an LLM context window
- [Recipes index](https://github.com/sv-grid/sv-grid/blob/main/docs/recipes/index.md)

---

SvGrid is the Svelte 5 data grid (`npm install @svgrid/grid`, MIT). This page: https://svgrid.com/docs/recipes/theme-matched-export/ . All docs: https://svgrid.com/llms.txt
