Styles the badge container.
Background Color: Fill behind the badge. Combined with a matching foreground color, this turns the component into a pill-style badge.
Horizontal Alignment: Where the badge sits inside its container when Stretch is off.
The Avonni Status component displays a small badge that maps a value to a predefined visual state — combining a label, an icon, and a color. Use it anywhere you need a clear, at-a-glance representation of a status field, such as a record's stage, priority, or health.
The Status component renders a read-only badge. You define the possible states up front (for example "Active", "Pending", "Archived"), then bind the component's Value to a Salesforce field — typically a picklist or formula — and the component automatically displays the matching state.
Use it on record pages, list rows, and dashboards anywhere you'd otherwise write conditional formula text.
This walkthrough builds a status badge for the Account Type field that shows green for Customer, orange for Prospect, and grey for Other.
Click into the States section.
Click + Add State three times and configure each:
Customer
Customer - Direct
utility:success
#2e844a (green)
Prospect
Prospect
utility:clock
#fe9339 (orange)
Other
Other
utility:info
#747474 (grey)
Why: The Value field of each state must match the Salesforce picklist API value exactly — that's how the component knows which state to render.
To configure the Status component, select it on the canvas. The configuration panel opens on the right. The sections below mirror the properties from top to bottom.
The value of the status to display. The component matches this against each state's Value and renders the first match. Typically bound to a Salesforce field using an expression like {!$Record.FieldName}.
The size of the icon displayed alongside the state label. Options: Xxs, Xs, Small, Medium (default), Large.
Describes the position of the icon relative to the label. Options: Left (default), Right.
If enabled, the status badge takes the entire available width of its container. When disabled, the badge sizes to fit its content.
The States collection defines every possible status the component can display. Each state specifies a unique combination of an icon and a color for visual clarity.
How matching works
When the component renders, it looks at the Value property and finds the first state whose Value matches. If no state matches, the component renders nothing — no error, no fallback.
Per-state settings
Label
The text shown to the user (for example, "Active").
No
Value
The internal identifier matched against the component's Value property. Must be unique across states. For Salesforce picklist sources, this is the picklist API value.
Yes (unique)
Icon Name
SLDS icon displayed alongside the label (for example, utility:success).
No
Color
The color applied to the state's icon and label text. Use Salesforce Lightning palette values for visual consistency.
No
Tooltip
Text displayed when the user hovers over the label. Useful for explaining what each status means.
No
Recommended Salesforce Lightning Colors
Match colors to the Salesforce design system so badges read consistently with the rest of the page.
Green
#2e844a
Success, Active, Customer, Won
Blue
#0176d3
Info, In Progress, Working
Orange
#fe9339
Warning, Pending, At Risk
Red
#ba0517
Error, Lost, Critical
Grey
#747474
Inactive, Archived, Unknown
All components support conditional visibility — see Component Visibility.
Renders a colored pill matching Salesforce's modern badge pattern.
Beyond the per-state color, the Style tab gives you control over the badge's appearance. Configure it from the Style tab of the configuration panel.
Controls the outer spacing around the badge — useful for sitting it inside a card or row.
Top / Right / Bottom / Left: Adjust the space on each side.
Controls the inner spacing between the badge's content and its border.
Top / Right / Bottom / Left: Adjust the inner spacing on each side.
Customizes the border surrounding the badge.
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.
Controls the badge'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.
Styles the badge container.
Background Color: Fill behind the badge. Combined with a matching foreground color, this turns the component into a pill-style badge.
Horizontal Alignment: Where the badge sits inside its container when Stretch is off.
Styles the status label text.
Font Size / Font Style / Font Weight / Font Family: Control the label typography.
Line Clamp: Truncates long labels after the specified number of lines.
Badge is blank — nothing displays — The Value doesn't match any state's Value. The component renders nothing instead of falling back, so a typo or mismatched picklist API name results in an empty badge. In Debug, log the bound field's value and verify it exactly matches one of the state values. Picklist values are case-sensitive — Closed Won and closed won are different.
Color and icon don't appear, only the label — The state matched but has no Icon Name or Color set. Open the matching state in the States editor and add the icon and color values.
Two states share the same value and the wrong one renders — State values must be unique; the component renders the first match. Edit the duplicate state and give it a unique value.
Tooltip doesn't appear on hover — The state has no Tooltip text, or the user is on a touch device (tooltips don't fire from tap). Add tooltip text to the state; for mobile, put critical context in the label itself instead of relying on the tooltip.
Badge takes full width when it shouldn't — Stretch is on. Turn off Stretch in the configuration panel.
Badge color doesn't match the surrounding page styling — The hex color is too saturated or doesn't align with Lightning Design System tokens. Use the Salesforce Lightning palette values from the table in the Configuration section.
Picklist value contains a space and doesn't match — Spaces in the Value field of the state need to match the picklist exactly, including spaces. Copy the picklist API value directly from Setup → Object Manager → the field's picklist values, then paste it into the state's Value.
Status component isn't reactive — it doesn't update when the record changes — Standard Lightning Record Page caching. Wire a Refresh Record Page action wherever the underlying field is updated, or rely on the user navigating away and back.
Last updated
Was this helpful?
Was this helpful?
