How to Use Conditional Formatting in Lightning Record Pages (Dynamic Highlight Panel)

Quick guide: configure conditional formatting rules and use them in Dynamic Highlight Panels to show icons and colors on fields in Lightning record pages (Case example).

What is Conditional Formatting in Lightning?

Conditional formatting lets you assign icons and colors to a field value so it appears highlighted on record pages and in highlight panels. This helps agents and users scan records faster — for example, coloring Case numbers by Census Type (Discharge = red, Admission = green).

When to use this

Use conditional formatting when you want visual cues on record pages to indicate status, priority, or any business-specific classification that should draw attention.

How it works (high level)

Rules are created at the object level and can include one or more conditions per rule. Each rule defines an icon and color. Once rules exist, you can assign them to a field on a Lightning Record Page or on a Dynamic Highlight Panel.

Step-by-step: Configure conditional formatting and apply it to a record page

  • Go to the Lightning App Builder and open the Record Page you want to update (e.g., Case Record Page).
  • Select the field you want to highlight (for the example in this article: Case Number).
  • On the right-hand inspector, open the Conditional Formatting dropdown. You’ll see rules already tied to the object. If none exist, use the + icon to add a new rule.
  • Create rules with one or more conditions. For each rule choose an icon and a color. Example rules:
    • Census Type = Discharge → Red (icon + color)
    • Census Type = Admission → Green
    • Census Type = Continued Stay AND NOMNC = Yes → Blue
    • Census Type = Continued Stay AND NOMNC = No → Purple
  • Save the rule(s).
  • To show the formatted field in the page header, add a Dynamic Highlight Panel to the record page (if not already present).
  • Edit the Dynamic Highlight Panel, select the same field and choose the conditional formatting rule to apply. The UI pulls the rules defined for the object.
  • Save and activate the page. Preview the record to verify icons and colors appear as expected.

Tips & considerations

  • Conditional formatting rules are defined per object and reusable across fields on that object.
  • Icons can be any supported icon — not limited to stars; you can upload or use available icon sets.
  • If you don’t see your rule in the page inspector, confirm the rule is active and tied to the correct object and field.
  • Conditional formatting is supported in Lightning Experience and subject to feature availability for your org — consult Salesforce Help for limitations.

Example use cases

Common uses include highlighting high-priority cases, flagging contracts near renewal, or visually indicating approval status on records.

Why this matters for Salesforce admins & developers

Conditional formatting is a low-code way to add strong visual signals to pages without custom components. Admins can quickly configure rules to improve agent productivity; developers can extend UX when rules need to be combined with custom components or LWC behaviors.

Reference: Salesforce: Conditional Formatting considerations