Overview
TheValue component displays a single formatted value from a query result. It’s useful for showing metrics inline within text or displaying individual data points.
Basic Usage
With Formatting
With Aggregation
Props
Data Selection
Query result, object, or array containing the value to display.
Column name to display. If not specified, uses the first column in the dataset.
Alias for
column. Use either column or value, not both.Row index to select from the dataset (0-based).
Aggregation function to apply to the column. When specified, aggregates all rows.
Formatting
Format string for the value. Examples:
"usd", "usd0", "pct1", "#,##0".Styling
Color for the value text. Accepts color names, hex codes, or theme colors.
Display negative values in red color.
Placeholder
Text to display when no data is provided. Shows
[placeholder text] with hover tooltip.Description text shown in an info tooltip next to the value.
Error Handling
How to handle empty datasets.
Custom message to display when dataset is empty.
Examples
Inline in Text
With Aggregations
With Color
With Data as Object
With Placeholder
Notes
- When using
agg, the component automatically aggregates the specified column across all rows - If both
valueandcolumnare provided,columntakes precedence - Colors can be specified as hex codes (
"#00FF00"), color names ("green"), or theme variables - The component automatically detects and formats date columns