Skip to content

AiAgentCard

Basic Usage

Display agent name, model, description, capability tags and statistics with click/use/favorite interactions.

ChatGPT-4o
gpt-4o

Most powerful multimodal AI assistant supporting image, audio, and video understanding.

Chat Code Image Analysis
1.2w uses4.8(2130) 420ms
DeepSeek-R1
deepseek-r1

Top reasoning model specializing in math, logic and deep analysis tasks.

Reasoning Coding Math
8.9k uses4.9(1560)

Layout Variants

Supports vertical (default), horizontal, and compact layouts.

Knowledge Assistant
RAG-GPT-4

Smart Q&A assistant based on enterprise private knowledge base, supports PDF, Word and more.

RAG Multi-format
5.3k uses4.7
Knowledge Assistant
RAG-GPT-4

Smart Q&A assistant based on enterprise private knowledge base, supports PDF, Word and more.

RAG Multi-format
5.3k uses4.7

Skeleton Loading

Use :loading="true" to show the skeleton screen.

API

Props

PropTypeDefaultDescription
dataAgentDatarequiredAgent data object
layout'vertical' | 'horizontal' | 'compact''vertical'Card layout direction
showActionsbooleantrueShow action buttons
showStatsbooleantrueShow statistics
favoritablebooleantrueEnable favorite
selectedbooleanfalseSelected state (highlighted border)
loadingbooleanfalseSkeleton loading state
themeOverridesComponentThemeVars-Theme override variables

AgentData

FieldTypeDescription
idstringUnique identifier
namestringAgent name
avatarstringAvatar URL or icon name
modelstringModel name
descriptionstringDescription text
capabilitiesAgentCapability[]Capability tag list
statsAgentStatsStatistics (usage, rating, etc.)
verifiedbooleanOfficial verified badge
status'online' | 'offline' | 'busy'Online status
favoritedbooleanInitial favorite state

Events

EventArgsDescription
click(data: AgentData)Card clicked
use(data: AgentData)Use button clicked
favorite(data: AgentData, favorited: boolean)Favorite toggled
share(data: AgentData)Share clicked

Slots

SlotDescription
avatarCustom avatar content
actionsCustom action button area (scoped: { data, use })
defaultExtra content at card bottom (scoped: { data })

Theme Variables

VariableDescription
--yh-ai-agent-card-bgCard background color
--yh-ai-agent-card-border-colorCard border color
--yh-ai-agent-card-avatar-sizeAvatar area size

Usage in Nuxt

vue
<!-- pages/agents.vue -->
<script setup lang="ts">
const { data: agents } = await useFetch('/api/agents')
</script>

<template>
  <div class="agent-grid">
    <YhAiAgentCard
      v-for="agent in agents"
      :key="agent.id"
      :data="agent"
      @use="navigateTo(`/chat?agentId=${agent.id}`)"
    />
  </div>
</template>
ts
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@yh-ui/nuxt'],
  yhUI: { importStyle: true }
})

Released under the MIT License.