The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
@metabase/custom-viz changelog
This changelog covers the @metabase/custom-viz npm package — the API and CLI for building custom visualizations for Metabase. Changes to how Metabase itself hosts custom visualization plugins are covered by the Metabase changelog.
2.0.1
Bug Fixes
- Security: updated Vite in scaffolded projects from 8.0.16 to 8.1.6 to pick up upstream security fixes (#85837).
- The scaffolded dev server no longer crashes when an asset file disappears before it's copied, which happened with editors that save through atomic writes, or when a directory is added to
public/assets. One save now triggers a single reload. Assets deleted frompublic/assetsare now removed fromdist/assetstoo (#83597).
Fix the asset watcher in existing projects
After upgrading, copy the new config from the package:
cp node_modules/@metabase/custom-viz/dist/templates/vite.config.ts vite.config.ts
If you've customized vite.config.ts, port the syncAssets function and the watch(assetsDirSrc, ...) callback from that file instead.
2.0.0
⚠ BREAKING CHANGES
columnandcolumn_settingsare now reserved setting ids, contributed to every visualization by Metabase to power the built-in per-column formatting popover. Plugins that declared their own settings under these ids must rename them — theSettingstype now rejects those keys with a type error (#78128).- Plugin settings are now stored under
custom:<plugin name>:<setting id>keys in a question'svisualization_settings, so a plugin can never write one of Metabase's own settings. Plugins keep using their own ids:settings,onChangeSettings,readDependencies,writeDependencies, anderaseDependenciesare translated by Metabase and refer to the plugin's own settings only (#81181). onChangeSettingsand the dependency lists are typed to the plugin's own setting ids. Writes to Metabase settings such ascard.titleorclick_behaviorno longer take effect (#81181).- Plugin settings saved by earlier plugin versions are adopted under the new keys automatically. Metabase settings an earlier plugin version already wrote, including
click_behavior, stay stored and keep taking effect until removed, so review click behavior on existing custom visualization cards (#81181). ClickObjectis no longer generic and no longer has asettingsfield. Metabase attaches the visualization's current settings to every click itself and ignores anything passed undersettings, so a click can't redirect dashboard click behavior. Aclick_behaviorsaved by an earlier plugin version stays in effect until removed (#81181).- The top-level
colorSchemevisualization prop moved into the newrenderingContextprop (see Features below). Readprops.renderingContext.colorSchemeinstead ofprops.colorScheme(#78429). - The
idfield of the visualization definition is removed. It was never read — Metabase identifies a visualization bynameinmetabase-plugin.json. Delete it from yourdefineConfigcall. - The module-level
measureText,measureTextWidth, andmeasureTextHeightexports are removed. The functions were stubs that always returned zero-size measurements — for real ones, usemeasureTexton the newrenderingContextprop (see Features below) (#78429).
Features
- Per-column formatting: visualization settings now include a
columnfunction that resolves a column's effective formatting settings — instance-wide defaults, the column's metadata settings, and the card-level settings from the column formatting popover, merged in that order. Pass its result toformatValueto render values the way the user configured them (#78128). - New
renderingContextvisualization prop with host rendering helpers:getColorresolves a Metabase color name to its current theme value,measureTextmeasures text the way Metabase renders it, returning{ width, height }from a single measurement (style.familydefaults to the instance font),fontFamilyexposes that font for styling your own markup, andcolorSchemetells you whether Metabase is rendering in light or dark mode (#78429). - New
@metabase/custom-viz packcommand packages a built visualization into an upload-ready.tgz. Scaffolded projects call it from theirbuildscript instead of carrying their own copy of the packaging script, so fixes to packaging and to the bundle size limits now come with a package upgrade. Pass--dirto pack a project in another directory. @metabase/custom-viz packstamps the exact@metabase/custom-vizversion into the packed manifest assdk.version. Your sourcemetabase-plugin.jsonis not modified. Metabase compares the stamp against the SDK versions it was tested with — a plugin outside that range (or outside its ownmetabase.versionrange) is never rejected; it uploads and runs normally, with a warning shown on the admin page.getNameis now optional and is what Metabase shows as the visualization name in the UI. Omit it to usenamefrommetabase-plugin.json; keep it to show a localized or human-friendly name.checkRenderableis now optional. Omit it when your visualization can render any data; keep throwing from it to surface a custom error. A visualization without acheckRenderableis always considered renderable (#81181).
Bug Fixes
FormatValueOptions["date_style"]now acceptsnull, matching the values Metabase actually passes (#70306).
Migrate to the pack command
Projects scaffolded before 2.0.0 have their own pack.mjs at the project root. To switch to the CLI:
Update
@metabase/custom-vizto 2.0.0 or newer.Change the
buildscript inpackage.jsonto:vite build && metabase-custom-viz packDelete
pack.mjs.Remove
tar-streamand@types/tar-streamfromdevDependencies, then reinstall.
Run npm run build to confirm you still get a <name>-<version>.tgz at the project root.
1.0.5 (2026-07-23)
Bug Fixes
- The
.gitignorein scaffolded projects now ignoresdist/and*.tgz(#78355).
Documentation
1.0.4 (2026-06-03)
Features
- Custom React components as setting widgets: a setting definition's
widgetnow accepts aReact.ComponentTypein addition to the built-in widget names, andgetPropsis typed to return the component's own props (minus the base props injected by the settings renderer) (#73941).
1.0.3 (2026-06-02)
Bug Fixes
- Security: updated Vite in scaffolded projects from 8.0.0 to 8.0.16 to pick up upstream security fixes (#75053).
1.0.2 (2026-06-01)
⚠ BREAKING CHANGES
- Removed
getAssetUrlfrom the visualization component props (CreateCustomVisualizationProps) — inline images and other static assets into your plugin code e.g. using base64 strings (#74960).
1.0.1 (2026-05-15)
⚠ BREAKING CHANGES
- Replaced
section?: stringwithgetSection?: () => stringin setting definitions, so section labels can be localized at call time (#74077).
1.0.0 (2026-05-08)
- Initial stable release.