Files
backstage/.changeset/grumpy-pugs-report.md
T
2021-11-10 15:19:58 +00:00

554 B

@backstage/core-components
@backstage/core-components
patch

Add new way to override color selection to progress bar/gauge components.

Gauge, LinearGauge and GaugeCard all accept a getColor prop, which is a function of the type:

export type GaugePropsGetColor = (args: {
  palette: Palette;
  value: number;
  inverse?: boolean;
  max?: number;
}) => string;

Return a standard CSS color string (e.g. "red", "#f02020"), and the gauge will be set to that color.

If the prop is omitted, the default implementation is unchanged from previous versions.