For the complete documentation index, see llms.txt. This page is also available as Markdown.

Metric

Overview

The Avonni Metric component displays a key performance indicator or numerical value with optional label, description, avatar, and a secondary metric — making it ideal for dashboards and KPI summaries.

Use the Metric component whenever you need to surface a single number prominently: total revenue, open case count, conversion rate, or any aggregate calculated directly from your Salesforce data. Use the secondary metric to compare with another value, such as last period.

When connecting to the Query data source, write a query targeting a specific Salesforce object and field, then apply an aggregate function (sum, average, count, etc.) to calculate the displayed value directly from your records.

Projects

See how Metric fits into a complete Salesforce workflow. This project includes steps to build it with AI or manually.

Cover

Add on to the highlight panel using Dynamic components and charts.

Cover

Compose an Agentforce agent with live account metrics that refresh as it answers.

Configuration

To configure the Metric, select it on the canvas. The Edit Metric panel opens on the right with three tabs: Properties, Interactions, and Style. The sections below mirror the Properties tab from top to bottom.

The Properties tab of the Edit Metric panel
The Properties tab. The first group of fields carries no heading in the panel; Avatar, Primary Metric and Secondary Metric are collapsible sections below it.

Value and Label

The top of the Properties tab controls the metric's text content and layout. It is the one group with no heading of its own in the panel.

A metric showing its label, description, value, secondary value and avatar
Every part of the component: the avatar, the Label above the Value, the Secondary Value beside it, and the Description underneath.
  • Label — Text displayed above (or below) the main value to name the metric being shown. Use the Label Position setting to place it at the top (default) or bottom.

  • Description — Additional text shown below the label to provide context, units, or a time range.

  • Value — The primary number to display. You can enter a static value or connect it to a Salesforce field. Requires Format Style to be set to a numeric mode (Decimal, Percent, Percent Fixed, or Currency). For a date value, set Format Style to Date instead — this switches the input to the Value date picker.

  • Secondary Value — A supporting number rendered near the main value. Configure its position, format, and trend options in the Secondary Metric section below.

  • Label Position — Controls where the label appears relative to the metric value: Top (default) or Bottom.

Avatar

Add an avatar to give the metric visual identity — for example, an icon representing the metric category or a record image.

  • Variant — Shape of the avatar: Circle or Square (default).

  • Initials — Text initials shown inside the avatar when no image is set.

  • Icon Name — Fallback icon displayed when the image fails to load.

  • Icon Size — Size of the avatar: X-Small, Small, Medium (default), Large, X Large, or Xx Large.

  • Image — URL or Content Document ID of the avatar image.

  • Alternative Text — Accessible description of the avatar image.

  • Position — Where the avatar is placed relative to the metric value: Left (default), Right, Bottom, or Top.

The four avatar Position values
The four values of the avatar Position.

Primary Metric

These settings control formatting and decoration of the main value. Which of them appear depends on Format Style, so they are grouped by the format they belong to.

Format Style

How the value is formatted: Decimal (default), Percent, Percent Fixed, Currency, or Date. Choosing Date switches the value input to a date picker and replaces the number settings with the date ones.

The five Format Style values rendered from the same kind of value
The five values of Format Style. Percent multiplies the value by 100, so 0.62 reads as 62%, while Percent Fixed takes the number as written, so 62 also reads as 62%.

Text around the value

Setting
Description

Prefix

Text shown immediately before the value (for example, ~ or >).

Suffix

Text shown immediately after the value (for example, pts or hrs).

Tooltip

Text displayed when a user hovers over the value.

Number formatting

All of these require Format Style to be Decimal, Currency, Percent, or Percent Fixed.

Setting
Description

Value Sign

Which sign is shown in front of the value: Negative (default, shows − for negative numbers) or Positive (shows + for positive numbers).

Maximum Fraction Digits / Minimum Fraction Digits

Bounds on the number of decimal places displayed.

Maximum Significant Digits / Minimum Significant Digits

Bounds on the total significant digits displayed.

Minimum Integer Digits

Minimum digits before the decimal point (zero-padded).

Currency

Both require Format Style = Currency.

Setting
Description

Currency Code

ISO 4217 code (e.g., USD) that determines which currency is displayed.

Currency Display As

How the currency identifier is shown: Symbol (default), Code (e.g., USD), or Name (e.g., US Dollar).

Trend

Setting
Description

Show Trend Color

When enabled, the value's color changes based on whether it is above or below the breakpoint (green for positive trend, red for negative). Requires Format Style = Decimal, Currency, Percent, or Percent Fixed.

Trend Breakpoint Value

The threshold number considered neutral. Values above it are treated as a positive trend; values below as negative. Requires Show Trend Color enabled.

Trend Icon

An icon rendered alongside the value to signal direction: Dynamic (arrow direction flips automatically), Arrow, or Caret. Requires Show Trend Color enabled.

Trend colour off, then the three Trend Icon values
Trend colouring off, then the three values of Trend Icon. The last metric sits below the breakpoint, so it turns red and the caret points down.

Date formatting

All of these require Format Style = Date.

Setting
Description

Day

Day format: 2-Digit or Numeric.

Month

Month format: 2-Digit, Narrow, Short, or Long.

Year

Year format: 2-Digit or Numeric.

Weekday

Weekday display: Narrow, Short, or Long.

Era

Era display: Narrow, Short, or Long.

Hour

Hour format: 2-Digit or Numeric.

Minute

Minute format: 2-Digit or Numeric.

Second

Second format: 2-Digit or Numeric.

Hour 12

When enabled, time displays in 12-hour format; otherwise 24-hour.

Timezone

IANA time zone (e.g., America/New_York). Defaults to the browser's time zone when empty.

Timezone Name

How the time zone label is shown: Short or Long.

Secondary Metric

A secondary value that provides comparison or context for the main metric, for example a change against the previous period.

The Secondary Metric section offers the same settings as Primary Metric, applied to the secondary value: Format Style, the text, number, currency, trend and date settings all behave as described above. The only difference is that each one is gated on Secondary Format Style rather than on Format Style.

These three have no equivalent in the primary section:

Setting
Description

Prefix

Text shown before the secondary value.

Suffix

Text shown after the secondary value.

Position

Where the secondary value appears relative to the main value: Bottom, Left, Right (default), or Top.

The four Secondary Metric Position values
The four values of the secondary Position.

Set Component Visibility

All components support conditional visibility — see Component Visibility.

Interactions

Interactions define what happens when users interact with the Metric. Configure them from the Interactions tab of the Edit Metric panel.

Primary Metric Click

Fires when a user clicks the primary metric. Use this to navigate to a detail page, open a flow, or drive any logic tied to the primary value.

Secondary Metric Click

Fires when a user clicks the secondary metric. Use this to trigger a separate action for the secondary value.

Styling

The Style tab gives you fine-grained control over the Metric's appearance. Configure it from the Style tab of the Edit Metric panel.

Controls the outer spacing around the metric, creating space between it and other elements.

  • Top / Right / Bottom / Left: Adjust the space on each side of the metric.

Controls the inner spacing between the metric's content and its border.

  • Top / Right / Bottom / Left: Adjust the inner spacing on each side.

Controls the metric's dimensions.

  • Width / Height: Set fixed dimensions.

  • Min Width / Max Width / Min Height / Max Height: Constrain the size within bounds.

  • Overflow: Control how content that exceeds the bounds is handled.

Customizes the border surrounding the metric.

  • Color: Set the border color.

  • Size: Adjust the border thickness.

  • Style: Choose a border style (e.g. solid, dashed, dotted).

  • Radius: Control the roundness of the corners.

Aligns the metric content within the component.

  • Alignment: Align the primary value, label, and description.

  • Secondary Alignment: Align the secondary value block.

Sets the metric's background.

  • Color: Set the background color or apply a gradient.

Styles the label text.

  • Color: Set the label text color.

  • Font Size / Font Style / Font Weight: Control the label typography.

  • Line Clamp: Limit the label to a maximum number of lines.

Styles the description text.

  • Color: Set the description text color.

  • Font Size / Font Style / Font Weight: Control the description typography.

  • Line Clamp: Limit the description to a maximum number of lines.

Styles the primary value.

  • Color: Set the value text color.

  • Font Size / Font Style / Font Weight: Control the value typography.

  • Line Height: Adjust the line height of the value.

Styles the text shown before the primary value.

  • Color: Set the prefix text color.

  • Font Size / Font Style / Font Weight: Control the prefix typography.

Styles the text shown after the primary value.

  • Color: Set the suffix text color.

  • Font Size / Font Style / Font Weight: Control the suffix typography.

Styles the secondary value and its parts.

  • Value: Color; Font Size / Font Style / Font Weight.

  • Prefix: Color; Font Size / Font Style / Font Weight.

  • Suffix: Color; Font Size / Font Style / Font Weight.

  • Trend: Background Color / Color / Radius (set per direction: Negative, Neutral, Positive).

Sets the colors used to represent the primary value's trend.

  • Negative Color / Neutral Color / Positive Color: Set the trend text color for each direction.

Styles the metric's avatar.

  • Icon Background Color / Icon Foreground Color: Set the fallback icon colors.

  • Border Color / Border Size / Border Style / Border Radius: Customize the avatar border.

  • Initials Color / Initials Color Hover / Initials Font Weight: Style the avatar initials.

  • Vertical Alignment: Align the avatar relative to the metric content.

Output Variables

The Metric exposes these output variables you can reference elsewhere on the page after the user interacts with it.

Interaction State

These variables reflect which metric the user last clicked.

Output variable
Type
What it returns

Primary Metric Clicked

Boolean

true when the user clicks the primary metric; use it to drive a visibility rule or conditional action.

Secondary Metric Clicked

Boolean

true when the user clicks the secondary metric.

Example: Use Primary Metric Clicked in a visibility rule to reveal a detail panel only after the user clicks the headline figure.

Last updated

Was this helpful?