Components/Agents
Universal Component

Agents

Agent picker list with loading, enabled/disabled grouping, selection, and badges.

This page was migrated by AI, please review carefully

Migration is complete, but please validate against source code and manual review.

Agents

TxAgentsList renders a selectable agent list for workflows and AI entry points. Enabled and disabled agents are grouped separately, loading and empty states are built in, and disabled items never emit selection events.

import { ref } from 'vue' const selectedId = ref<string | null>('chat') const loading = ref(false) const agents = [ { id: 'chat', name: 'Chat Agent', description: 'General conversation assistant', iconClass: 'i-carbon-chat', badgeText: 6, }, { id: 'code', name: 'Code Agent', description: 'Code generation & refactor', iconClass: 'i-carbon-code', badgeText: 12, }, { id: 'search', name: 'Search Agent', description: 'Web search & citations', iconClass: 'i-carbon-search', }, { id: 'disabled', name: 'Disabled Agent', description: 'Not available', iconClass: 'i-carbon-bot', disabled: true, }, ]

Basic Usage

AgentsList

Demo will load when visible.
<script setup lang="ts">
import { ref } from 'vue'

const selectedId = ref<string | null>('chat')
const loading = ref(false)
const agents = [
  { id: 'chat', name: 'Chat Agent', iconClass: 'i-carbon-chat', badgeText: 6 },
  { id: 'code', name: 'Code Agent', iconClass: 'i-carbon-code', badgeText: 12 },
  { id: 'disabled', name: 'Disabled Agent', disabled: true },
]
</script>

<template>
  <TxAgentsList
    :agents="agents"
    :loading="loading"
    :selected-id="selectedId"
    @select="(id) => (selectedId = id)"
  />
</template>

API

TxAgentsList

Props

PropTypeDefaultDescription
agentsAgentItemProps[]-Agent records to render. Enabled items are listed before disabled items.
selectedIdstring | nullnullMarks the matching agent as selected.
loadingbooleanfalseShows list item skeletons instead of agent rows.
enabledTitlestring'Enabled'Section title for agents where disabled is not set.
disabledTitlestring'Disabled'Section title for agents where disabled=true.
emptyTextstring'No agents'Message shown when agents is empty and the list is not loading.

Events

EventParamsDescription
select(id: string)Emitted with the selected agent id when an enabled item is clicked or activated from the keyboard.

TxAgentItem

Props

PropTypeDefaultDescription
idstring-Stable id emitted by select.
namestring-Primary agent label.
descriptionstring''Optional secondary text below the name.
iconClassstring'i-carbon-bot'Icon class rendered in the avatar area.
selectedbooleanfalseApplies active styling and aria-selected=true.
disabledbooleanfalseDisables pointer and keyboard selection and applies aria-disabled=true.
badgeTextstring | number''Optional right-side badge content; empty, null, or undefined hides the badge.

Events

EventParamsDescription
select(id: string)Emitted only when the item is enabled and activated by click, Enter, or Space.

Slots

SlotDescription
badgeReplaces the default right-side badge content when badgeText is present.