Skip to content

ExportMenu

Open .md
Live preview

Loading example…

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

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

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

export const Default: Story = {};

Source of the Storybook story.

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.

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