Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)7.2k · #13474

thinking-orbs

Skill này làm gì

Skill này thêm component thinking-orbs cho React, cho thấy một AI đang bận. Phù hợp với lập trình viên xây giao diện chat, copilot, tìm kiếm hoặc giọng nói muốn một chỉ báo trạng thái rõ ràng thay vì vòng xoay đơn giản.

Khi nào nên dùng

  • ✓Khi một giao diện chat hoặc copilot cần cho thấy AI đang làm việc hoặc đang tìm kiếm.
  • ✓Khi bạn muốn thay một vòng xoay chung chung bằng chỉ báo hoạt động AI.
  • ✓Khi một tính năng giọng nói hoặc tạo nội dung phải cho thấy nó đang lắng nghe hoặc soạn thảo.

Liên kết skill

https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/thinking-orbs/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/thinking-orbs/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn ứng dụng chat hiện một quả cầu nhỏ có hoạt ảnh khi AI đang suy nghĩ, thay vì một vòng xoay đơn giản.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent cài gói trong một dự án React và ánh xạ các bước thật trong ứng dụng vào một trong sáu trạng thái có sẵn. Agent đặt kích thước, chủ đề và nhãn, rồi thêm tùy chọn giảm chuyển động để quả cầu có thể tạm dừng hoặc ẩn đi vì khả năng tiếp cận.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Thinking Orbs

Core Contract

  1. Use thinking-orbs in React 18+ interfaces that need indeterminate AI activity feedback.
  2. Map the real product lifecycle to one of the six shipped states.
  3. Use only the tuned 20 or 64 pixel size. Do not stretch one preset into another.
  4. Keep theme="auto" unless the surrounding surface has a known fixed theme.
  5. Pair the orb with concise visible status text when the activity matters to the user.
  6. Override aria-label with a task-specific label, or hide the orb from assistive technology when adjacent live text already announces the same state.
  7. Use paused to freeze the current frame. Do not simulate pause with speed={0}.
  8. Treat the orb as indeterminate feedback, never as a progress percentage or completion signal.

The package renders monochrome dots on a transparent 2D canvas. It does not expose custom colors, arbitrary sizes, or determinate progress.

Install

Inspect the project package manager, then install:

npm install thinking-orbs

The package declares react and react-dom version 18 or newer as peer dependencies. Import the component and exported types from the package root:

import {
  ThinkingOrb,
  type OrbSize,
  type OrbState,
  type OrbTheme,
  type ThinkingOrbProps,
} from "thinking-orbs";

Choose the State

  • working — generic tool execution, multi-step work, or an activity without a more precise state.
  • searching — retrieval, web search, file search, or knowledge lookup.
  • solving — reasoning, analysis, calculation, or planning.
  • listening — microphone input, speech capture, or waiting for a spoken turn.
  • composing — writing, summarizing, drafting, or generating a text response.
  • shaping — creating or refining an image, layout, structured artifact, or other formed output.

Prefer a truthful generic working state over a visually interesting but inaccurate state. Change the state only when the underlying activity changes.

Choose the Size

  • Use size={20} inline with text, inside buttons, or in compact status rows.
  • Use size={64} at chat-avatar scale, in an empty state, or as the main visual status.

The presets have different dot counts, dot sizes, and speed tuning. They are separate designs rather than a scale factor. If the layout needs more surrounding space, size the wrapper instead of applying CSS transforms to the canvas.

Basic Usage

import { ThinkingOrb } from "thinking-orbs";

export function AgentStatus() {
  return (
    <ThinkingOrb
      state="searching"
      size={20}
      theme="auto"
      aria-label="Searching project files…"
    />
  );
}

All other canvas props pass through, including className, style, data-*, event handlers, and ARIA attributes.

Model the Product Lifecycle

Keep product phases separate from visual states so the mapping stays explicit:

import { ThinkingOrb, type OrbState } from "thinking-orbs";

type AgentPhase =
  | "idle"
  | "retrieving"
  | "reasoning"
  | "writing"
  | "creating"
  | "done"
  | "error";

const ORB_BY_PHASE: Partial<Record<AgentPhase, OrbState>> = {
  retrieving: "searching",
  reasoning: "solving",
  writing: "composing",
  creating: "shaping",
};

export function AgentActivity({ phase }: { phase: AgentPhase }) {
  const state = ORB_BY_PHASE[phase];
  if (!state) return null;

  return <ThinkingOrb state={state} size={20} />;
}

Remove the orb on done, error, cancellation, or idle. Show the appropriate result, retry, or error UI instead of leaving the last activity animation running.

Announce Status Once

The component defaults to role="img" with a per-state label such as “Searching…”. When visible text describes the same state, make the text the single announcement source:

export function LiveAgentStatus() {
  return (
    <div role="status" aria-live="polite" className="agent-status">
      <ThinkingOrb state="solving" size={20} aria-hidden="true" />
      <span>Reviewing the repository…</span>
    </div>
  );
}

Use aria-live="polite" for ordinary phase changes. Avoid rapid label churn. Do not add another hidden live region when role="status" already owns the announcement.

Theme

Use one of:

<ThinkingOrb theme="auto" />
<ThinkingOrb theme="dark" />
<ThinkingOrb theme="light" />
  • auto first checks an ancestor data-theme="dark|light" attribute or dark / light class.
  • If no ancestor theme exists, auto follows prefers-color-scheme.
Câu hỏi thường gặp

Nó có cho thấy tác vụ đã đi được bao xa không?

Không. Quả cầu chỉ thể hiện hoạt động không xác định, không bao giờ hiện phần trăm hay việc hoàn thành.

Cần phiên bản React nào?

Gói cần React 18 trở lên.

Có chọn được màu tùy chỉnh không?

Không. Skill nói gói hiển thị các chấm đơn sắc và không cho phép đặt màu hay kích thước tùy ý.

Chi tiết

Mô tả gốc của tác giả

Add accessible animated AI loading and agent-status indicators with the React thinking-orbs library. Use when a chat, copilot, voice, search, generation, or tool-running interface needs a semantic working, searching, solving, listening, composing, or shaping state; when replacing a generic spinner with an AI activity orb; or when implementing the library's size, theme, speed, pause, reduced-motion, and canvas behavior.

repo: MengTo/Skills

Độ phổ biến

Sao GitHub
7.2k
Vị trí xếp hạng
#13474
Giấy phép
MIT
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự