Resource Badge
Displays a badge with consistent icons, colors, and labels for resource types.
Overview
The ResourceBadge component is a specialized badge wrapper that provides predefined configurations for displaying different resource types as defined by integrity-py . It automatically applies appropriate icons, colors, and labels.
Usage
Import the component:
tsx
import { ResourceBadge } from "@eqtylab/equality";Basic usage requires only a type prop:
tsx
<ResourceBadge type="database" />Variants
Display Options
With Icon and Label (Default)
The default display shows both icon and label:
tsx
<ResourceBadge type="model" />Icon Only
Show only the icon by setting display to "icon-only":
tsx
<ResourceBadge type="database" display="icon-only" />Label Only
Show only the text by setting display to "text-only":
tsx
<ResourceBadge type="document" display="text-only" />Props
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
type | The resource type that determines the badge variant, icon, and label. | "agent", "benchmark", "benchmark-result", "binary", "code", "compute", "config", "database", "dataset", "document", "guardrail", "media", "model", "prompt", "reasoning", "skill", "system-prompt", "token", "tool", "unknown" | ✅ | |
display | Controls what elements are displayed: icon, text, or both. | "both", "text-only", "icon-only" | "both" | ❌ |