Equality
Equality

Resource Badge

Displays a badge with consistent icons, colors, and labels for resource types.

View Markdown

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:

import { ResourceBadge } from "@eqtylab/equality";

Basic usage requires only a type prop:

<ResourceBadge type="database" />

Variants

With Icons (default)
Code
Binary
Configuration
Compute
Database
Dataset
Document
Media
Skill
Guardrail
Benchmark
Benchmark Result
Agent
Model
Prompt
System Prompt
Reasoning
Token
Certificate
Credential
Tool
Unknown
Label Only
Code
Binary
Configuration
Compute
Database
Dataset
Document
Media
Skill
Guardrail
Benchmark
Benchmark Result
Agent
Model
Prompt
System Prompt
Reasoning
Token
Certificate
Credential
Tool
Unknown
Icon Only

Display Options

With Icon and Label (Default)

The default display shows both icon and label:

<ResourceBadge type="model" />

Icon Only

Show only the icon by setting display to "icon-only":

<ResourceBadge type="database" display="icon-only" />

Label Only

Show only the text by setting display to "text-only":

<ResourceBadge type="document" display="text-only" />

Custom Content

By default, Resource Badge displays the label associated with the type. You can pass children to override that label.

This may be used to display the name of a resource on the badge, though displaying names separately is generally preferred.

claude-opus-4-7
Dataset Group
aws-prod-key

Usage

<ResourceBadge type="model">claude-opus-4-7</ResourceBadge>

Closable

Set closeable and provide a handleClosable callback to render a close button on the badge. This is useful for representing active filters or selections that the user can dismiss.

Usage

<ResourceBadge
  type="dataset"
  closeable
  handleClosable={() => removeFilter("dataset")}
>
  customer-events-2026
</ResourceBadge>

Props

NameDescriptionTypeDefaultRequired
typeThe resource type that determines the badge variant, icon, and label."agent", "benchmark", "benchmark-result", "binary", "certificate", "code", "compute", "config", "credential", "database", "dataset", "document", "guardrail", "media", "model", "prompt", "reasoning", "skill", "system-prompt", "token", "tool", "unknown"
displayControls what elements are displayed: icon, text, or both."both", "text-only", "icon-only""both"
childrenCustom content to display in place of the default type label.ReactNode
closeableWhen true, displays a close button on the badge.booleanfalse
handleClosableCallback called when the close button is clicked.() => void