JGuang

Task Rows

Task Rows · Beautiful UI

Preview
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/task-rows.json

Task Rows

Install: npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/task-rows.json

When to use

Present an agent task breakdown and expandable subtask details.

Key props and data

Native propMeaning
rowsUse stable key, label, amount, status, optional step and details.
variantCapsules or List selects a native arrangement.
onToggleRowReceives the stable row key and new open state.

Interaction and state checks

Use done, running or sequence for status. Check each supported status, both layouts and detail expansion.

Integration boundaries

The failed label is display copy, not a public failed status value. Supply real execution status yourself; the component does not run jobs.

The runnable usage and source reference below preserve the native API. These practical guides do not claim a full translation of upstream prose.

Runnable usage

Install a complete example below first, then import its installed entry. Parameterized example source, shared helpers, native components and CSS are included; no manual relative-import edits are required.

import Demo from '@/components/beautiful-ui/examples/presets/task-rows-task-data';
import '@/styles/beautiful-ui.css';
export default function Example() { return <Demo />; }

Preview states

Capsules, List, Task data, Task list

Demo state and mock data do not provide a backend service. Inspect the component props before wiring real data.

Live agent task status — running, failed, completed.

Complete example installation

These are runnable native states and parameterized usage scenarios, not additional components. Each bundle includes its source closure, helpers, pinned dependencies, independent CSS and licenses. Scenario names are not new native component props; consult the source API below.

Capsules

npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/task-rows/task-rows-capsules.json

Default import: @/components/beautiful-ui/examples/presets/task-rows-capsules

Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1

List

npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/task-rows/task-rows-list.json

Default import: @/components/beautiful-ui/examples/presets/task-rows-list

Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1

Task data

npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/task-rows/task-rows-task-data.json

Default import: @/components/beautiful-ui/examples/presets/task-rows-task-data

Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1

Task list

npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/task-rows/task-rows-task-list.json

Default import: @/components/beautiful-ui/examples/presets/task-rows-task-list

Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1

Initialize Tailwind CSS v4, import beautiful-ui.css once and synchronize theme with the host html dark class. Examples read html lang for Chinese/English and do not supply backend, authentication or recording. Network/clipboard availability still depends on the browser.

Source-backed parameter reference

Implementation signatures and types are generated from the pinned local source. Optional props, native inherited types, union branches and never exclusions are preserved. A forwardRef implementation's ref is a React reference, not an additional business prop.

TaskRows({
  variant = "Capsules",
  rows = TASK_ROWS,
  labels,
  className,
  onToggleRow,
}: {
  variant?: string;
  rows?: TaskRow[];
  labels?: Partial<TaskRowsLabels>;
  className?: string;
  onToggleRow?: (key: string, open: boolean) => void;
})
export type TaskDetail = { label: string; meta: string };

export type TaskRow = {
  key: string;
  label: string;
  amount: string;
  status: "done" | "running" | "sequence";
  step?: number;
  details: TaskDetail[];
};

export type TaskRowsLabels = {
  completed: string;
  failed: string;
};

Destructuring defaults in source

Only defaults written directly in parameter/props destructuring are listed. Conditional expressions, runtime theme and computed values require source inspection; this is not an exhaustive behavior-default list.

// TaskRows
variant = "Capsules"

// TaskRows
rows = TASK_ROWS

Native and external types

External types remain defined by React or native dependencies, not manually expanded into guessed props. The installed version's TypeScript definitions are authoritative.

Partial<TaskRowsLabels>