- Implementation
- DiffValue Props
Common Examples
To use theDiffValue, import it from @servicetitan/anvil2-ai-kit and pass the previous value through from and the proposed value through to.Automatic layout
DiffValue uses inline layout for short, single-line values. It switches to block layout when either value exceeds 80 characters or contains a newline. Pass layout to override the automatic choice.Empty and removed values
Omitfrom, pass null, or pass whitespace to render the localized empty label. Do the same for to to render the localized removed label.Truncation
Block layout usesTruncatedText. Set truncateLines to control the collapsed line limit.Internationalization
DiffValue uses three messages:ai-kit.diffValue.emptyai-kit.diffValue.removedai-kit.diffValue.changedFromTo
AiKitIntlProvider inside CartoTheme to switch locale or override these strings. The changedFromTo message receives {from} and {to} values.React Accessibility
- A visually hidden localized summary announces the relationship as “Changed from X to Y.”
- Inline layout hides duplicate visual values from assistive technology.
- Block layout keeps Show more and Show less controls reachable when either value is truncated.
- The arrow is decorative and hidden from assistive technology.