progress Renderer
renderAs: 'progress' renders a numeric value (0–100) as a horizontal filled bar. Use it for completion percentages, SLA indicators, capacity gauges, or any bounded metric.
Core Examples
Basic Progress Bar
Completion percentage rendered as a progress bar with percentage label.
{ key: 'completion', renderAs: 'progress', renderAsOptions: { height: '12px', showPercentage: true } }
Dynamic Color and Styling
color accepts a function receiving the entity — use it to color the bar based on value thresholds. textColor controls the percentage label text color.
SLA bar: green ≥80, amber ≥60, red below. Quota bar: custom purple with white label.
{
key: 'sla',
renderAs: 'progress',
renderAsOptions: {
height: '8px',
showPercentage: false,
color: (entity) =>
entity.sla >= 80 ? '#16a34a' : entity.sla >= 60 ? '#d97706' : '#dc2626',
backgroundColor: '#e5e7eb',
},
},
{
key: 'quota',
renderAs: 'progress',
renderAsOptions: { height: '16px', showPercentage: true, color: '#6d28d9', textColor: '#ffffff' },
},
Options Reference
| Option | Type | Default | Effect |
|---|---|---|---|
height | number | CSS string | '20px' | Height of the bar. Numbers are interpreted as px. |
showPercentage | boolean | true | Show numeric percentage label inside or beside the bar. |
color | string | (entity) => string | '#007bff' | Fill color. Accepts a function for per-row dynamic coloring. |
backgroundColor | string | (entity) => string | '#e9ecef' | Track background color. |
textColor | string | (entity) => string | '#000' | Percentage label text color. |
className | string | unset | Additional CSS class on the root element. |
Caveats
- Values are clamped to
[0, 100]. A value of150renders a full bar without error. - Non-numeric values render as an empty bar (value treated as
0). - For scores with semantic bands (e.g. Critical / Watch / Healthy), use
scoreMeterinstead — it adds labeled band chips.
See Also
- scoreMeter Renderer — banded score display with labels
- number Field Type
- Field Config