Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Infiniflow Ragflow RAGFlowAvatar Component

From Leeroopedia
Revision as of 11:22, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Infiniflow_Ragflow_RAGFlowAvatar_Component.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Frontend, UI_Components
Last Updated 2026-02-12 06:00 GMT

Overview

Concrete avatar component with hash-based automatic color selection and responsive font sizing provided by the RAGFlow frontend.

Description

The RAGFlowAvatar component renders an avatar image or, when no image is available, a colored initial-letter circle. It uses a SHA-like hash of the name to deterministically select from a predefined set of gradient colors, and employs ResizeObserver for responsive font sizing.

Usage

Import this component anywhere user or entity avatars are displayed, such as user profiles, knowledge base cards, agent cards, and chat messages.

Code Reference

Source Location

Signature

export const RAGFlowAvatar = memo(forwardRef<
  HTMLSpanElement,
  React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> & {
    name?: string;
    avatar?: string;
    isPerson?: boolean;
  }
>(function RAGFlowAvatar(props, ref)));

Import

import { RAGFlowAvatar } from '@/components/ragflow-avatar';

I/O Contract

Inputs

Name Type Required Description
name string No Entity name for initial and color selection
avatar string No Image URL or base64 for avatar display
isPerson boolean No Whether this represents a person

Outputs

Name Type Description
Rendered JSX JSX.Element Avatar circle with image or colored initial

Usage Examples

import { RAGFlowAvatar } from '@/components/ragflow-avatar';

<RAGFlowAvatar name="John Doe" avatar="/avatars/john.png" />
<RAGFlowAvatar name="Knowledge Base A" /> {/* Shows colored "K" */}

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment