Agent List

Paginated list of AI agents with status badges and filters

SaaSAI Agents

Overview

AgentList displays AI agents in a sortable, filterable table with pagination. Supports status filtering, row selection, and per-agent actions (view, edit, delete, activate, archive). Each row shows the agent name, status badge, description, model configuration, and creation date. Includes loading, empty, and error states.

Usage

import { AgentList } from "@leanicon/web-builder-library/saas";

<AgentList
  agents={agents}
  totalCount={100}
  page={1}
  pageSize={10}
  onPageChange={setPage}
  onPageSizeChange={setPageSize}
  filters={filters}
  onFiltersChange={setFilters}
  onView={(agent) => router.push(`/agents/${agent.id}`)}
  onEdit={(agent) => router.push(`/agents/${agent.id}/edit`)}
  onDelete={(agent) => deleteAgent(agent.id)}
  onActivate={(agent) => activateAgent(agent.id)}
  onArchive={(agent) => archiveAgent(agent.id)}
/>;

Variants

Loading

ToolsKBs
Showing 1 to 0 of 0 results
Rows per page:
Page 1 of 0

Empty

No agents found. Create your first agent to get started.

With Error

Failed to load agents. Please try again.

Dark

ToolsKBs
Showing 1 to 0 of 0 results
Rows per page:
Page 1 of 0

AgentStatusBadge - All Statuses

DraftActiveArchived

AgentStatusBadge - All Sizes

ActiveActiveActive

AgentStatusBadge - Without Dot

Active

Default with Data (code only)

<AgentList
  agents={[
    {
      id: "agent_001",
      tenantId: "tenant_001",
      name: "Customer Support Agent",
      description: "Handles customer inquiries and troubleshooting.",
      systemPrompt: "You are a helpful customer support agent...",
      status: "active",
      modelConfig: { provider: "openai", model: "gpt-4o", temperature: 0.7, maxTokens: 2048 },
      settings: {
        welcomeMessage: "Hello! How can I help?",
        enableMemory: true,
        enableStreaming: true,
      },
      createdAt: "2026-01-01T09:00:00Z",
      updatedAt: "2026-01-20T14:30:00Z",
      createdBy: "user_001",
      updatedBy: "user_002",
    },
    {
      id: "agent_002",
      tenantId: "tenant_001",
      name: "Sales Assistant",
      description: "Assists with product inquiries and pricing.",
      systemPrompt: "You are a knowledgeable sales assistant...",
      status: "active",
      modelConfig: { provider: "openai", model: "gpt-4o", temperature: 0.5, maxTokens: 2048 },
      settings: { welcomeMessage: "Welcome!", enableMemory: true, enableStreaming: true },
      createdAt: "2026-01-05T09:00:00Z",
      updatedAt: "2026-01-18T11:00:00Z",
      createdBy: "user_001",
      updatedBy: "user_001",
    },
  ]}
  totalCount={2}
  page={1}
  pageSize={10}
  onPageChange={(page) => setPage(page)}
  onPageSizeChange={(size) => setPageSize(size)}
  onView={(agent) => router.push(`/agents/${agent.id}`)}
  onEdit={(agent) => router.push(`/agents/${agent.id}/edit`)}
  onDelete={(agent) => deleteAgent(agent.id)}
  onActivate={(agent) => activateAgent(agent.id)}
  onArchive={(agent) => archiveAgent(agent.id)}
/>

With Filters and Sorting (code only)

<AgentList
  agents={agents}
  totalCount={42}
  page={1}
  pageSize={10}
  filters={{ status: ["active"] }}
  sortBy="createdAt"
  sortOrder="desc"
  selectedIds={[]}
  onFiltersChange={(filters) => setFilters(filters)}
  onSortChange={(sortBy, order) => handleSort(sortBy, order)}
  onSelectionChange={(ids) => setSelectedIds(ids)}
  onPageChange={setPage}
  onPageSizeChange={setPageSize}
  onView={(agent) => router.push(`/agents/${agent.id}`)}
  onEdit={(agent) => router.push(`/agents/${agent.id}/edit`)}
  onDelete={(agent) => deleteAgent(agent.id)}
  onActivate={(agent) => activateAgent(agent.id)}
  onArchive={(agent) => archiveAgent(agent.id)}
/>

Props

NameTypeDefaultRequiredDescription
agentsAgent[]—YesArray of agents to display
totalCountnumber—YesTotal count for pagination
isLoadingbooleanfalseNoLoading state
errorstring—NoError message
pagenumber—YesCurrent page (1-indexed)
pageSizenumber—YesPage size
onPageChange(page: number) => void—YesCallback when page changes
onPageSizeChange(pageSize: number) => void—YesCallback when page size changes
filtersAgentFilters{}NoCurrent filters
onFiltersChange((filters: AgentFilters) => void)—NoCallback when filters change
sortBystring—NoCurrent sort column
sortOrderenumascNoCurrent sort order
onSortChange((sortBy: string, order: "desc" | "asc") => void)—NoCallback when sort changes
selectedIdsstring[][]NoSelected agent IDs
onSelectionChange((ids: string[]) => void)—NoCallback when selection changes
onBulkAction((action: string, ids: string[]) => void)—NoCallback for bulk actions
onView((agent: Agent) => void)—NoCallback when view is clicked
onEdit((agent: Agent) => void)—NoCallback when edit is clicked
onDelete((agent: Agent) => void)—NoCallback when delete is clicked
onActivate((agent: Agent) => void)—NoCallback when activate is clicked
onArchive((agent: Agent) => void)—NoCallback when archive is clicked
onStatusChange((agent: Agent, status: AgentStatus) => void)—NoCallback when status changes
emptyMessagestringNo agents foundNoEmpty state message
emptyActionReactNode—NoEmpty state action
emptyStateReactNode—NoCustom empty state component
getAgentHref((agent: Agent) => string)—NoGet href for agent link (makes agent name clickable)
onAgentClick((agent: Agent) => void)—NoCallback when agent name is clicked
classNamestring—NoAdditional class names