# ExportMenu

> Two compact buttons that download the chart drawing as SVG or PNG.

Source: https://ui.jcsoftdev.com/docs/components/export-menu

Two compact buttons that download the chart drawing as SVG or PNG.
`getSvgs` runs on click, so it can read the live DOM.

## Import

```ts
import { ExportMenu } from "@jcsoftdev/ui/charts";
```

Single-component entry points tree-shake to just this component: `@jcsoftdev/ui/charts/core`.

## Usage

```tsx
export const Default: Story = {};
```

_Source of the Storybook story._

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `title` * | `string` |  |  |
| `getSvgs` * | `(root: HTMLElement) => SVGSVGElement[]` |  | Receives the menu's own element, to find the chart around it. |
| `getLeading` | `((root: HTMLElement) => SVGSVGElement \| null)` |  | A mounted drawing placed left of the others; removed from the page once exported. |
| `texts` | `ExportTexts` | `DEFAULT_EXPORT_TEXTS` |  |
| `className` | `string` |  |  |

`*` marks a required prop.

## Storybook stories

- [Default](/storybook/?path=/story/charts-primitives-exportmenu--default)
- [Spanish](/storybook/?path=/story/charts-primitives-exportmenu--spanish)

## Source

`packages/ui/src/charts/core/export-menu.tsx`
