Skip to main content
The Label component displays classification results with confidence scores.

Basic usage

Constructor

dict[str, float] | str | float | Callable | None
default:"None"
Default value:
  • Dict of {label: confidence} pairs
  • Single string/number label
  • Function that returns label data
int | None
default:"None"
Number of top classes to display
str | None
default:"None"
Label displayed above component
str | None
default:"None"
Background color as CSS color name or hex code
bool
default:"True"
Whether to show the top class as heading

Events

  • change - Triggered when value changes
  • select - Triggered when label is selected

Examples

Multi-class classification

Single label

With custom color