Labels and Actions
Browse these live examples and open Code to inspect their configuration.
Labels and actions
Section titled “Labels and actions”| Renderer | When to use it | Configure on the column |
|---|---|---|
countBadgeRenderer | Highlight positive counts and show an empty placeholder. | countBadge.format, countBadge.empty |
badgeRenderer | Display a value as a colored badge. | badgeStyles |
ratingStarRenderer | Visualize a numeric rating as stars. | maxStars, ratingAriaLabel, ratingValueLabel |
thumbsRenderer | Display a positive or negative vote. | boolean-like cell value |
avatarRenderer | Display an avatar or initials for a person. | avatarProp, avatarLabelProp, avatarSize |
avatarWithTextRenderer | Show an avatar alongside a person’s name. | avatarProp, avatarLabelProp, avatarSize |
identityCellRenderer | Show an entity label with optional detail and image. | identityCell.format, optional onActivate |
entityCellRenderer | Select identity or group presentation by row. | entityCell.format, optional onActivate |
metricStackRenderer | Show a primary value with supporting text and an optional icon. | metricStack.format |
cellActionRenderer | Expose a labeled row action. | cellAction |
statusActionRenderer | Provide a compact action with a status and label. | statusAction |
choiceStatusRenderer | Display an actionable status choice or summary. | choiceStatus |
heatActionRenderer | Combine a heat-colored value with a labeled action. | heatAction |
visualCellRenderer | Choose a visual presentation based on the row. | visualCell.format, optional onActivate |
groupRailRenderer | Show an expandable group rail with custom details. | groupRail |
groupSummaryRenderer | Show an expandable group summary and selectable segments. | groupSummary |
Use countBadgeRenderer for values such as open roles. Positive numbers appear as badges; zero, missing, negative, and invalid values use the empty placeholder. Format numbers and provide the empty label in the host locale:
import { countBadgeRenderer } from '@revolist/revogrid-pro';
const column = { prop: 'openRoles', cellTemplate: countBadgeRenderer, countBadge: { format: (count) => new Intl.NumberFormat('en').format(count), empty: '—', },};Customize its colors using --rv-count-badge-background, --rv-count-badge-border, and --rv-count-badge-color.
Inline metrics with icons
Section titled “Inline metrics with icons”Use metricStackRenderer for a metric with a decorative icon and supporting text, such as a match count and its reporting period. Choose icon: 'activity', or provide a function that renders your own icon. align: 'start' places the content at the leading edge, and muted dims inactive rows. The value and period text come from the host. See metricStackRenderer in the examples above.
{ prop: 'matches', cellTemplate: metricStackRenderer, metricStack: { format: (value, row) => ({ value: String(value), detail: '7d', icon: 'activity', layout: 'inline', align: 'start', muted: !row.enabled, }), },}