Keep migrating the remaining routes.
Kits
TranscriptDivider
Toned run-boundary separator for transcripts: steering, interruptions, and condensed context.
Composition
Run boundary
- <TranscriptDivider>
- <TranscriptDividerLabel />
Installation
Use this command to install the component.
npx shadcn@latest add https://control-ui.dev/r/transcript-divider.jsonUsage
import { TranscriptDivider } from "@/components/control-ui/transcript-divider";
type RunBoundary = { id: string; kind: "condensed" | "interrupted" | "failed"; summary: string;};
const boundaryTone = { condensed: "neutral", interrupted: "warning", failed: "danger",} as const;
export function Example({ boundaries }: { boundaries: RunBoundary[] }) { return ( <> {boundaries.map((boundary) => ( <TranscriptDivider key={boundary.id} tone={boundaryTone[boundary.kind]}> {boundary.summary} </TranscriptDivider> ))} </> );}
Raw code
Installed component source and support files
import type { ComponentProps, CSSProperties } from "react";import { isValidElement } from "react";import type { TranscriptDividerKnobStyle } from "@/components/control-ui/knob-contracts/transcript-divider-knobs";import { cn } from "@/components/control-ui/lib/cn";
export type ChatTone = "neutral" | "success" | "warning" | "danger";
export type TranscriptDividerProps = Omit<ComponentProps<"div">, "style"> & { tone?: ChatTone; style?: CSSProperties & TranscriptDividerKnobStyle;};
export function TranscriptDivider({ tone = "neutral", className, children, ...props }: TranscriptDividerProps) { const isLabel = isValidElement(children) && children.type === TranscriptDividerLabel;
return ( <div role={children == null ? "separator" : undefined} data-control-ui="transcript-divider" data-control-family="transcript-divider" data-slot="root" data-tone={tone} className={cn("flex min-w-0 items-center before:flex-1 after:flex-1", className)} {...props} > {children == null || isLabel ? children : <TranscriptDividerLabel>{children}</TranscriptDividerLabel>} </div> );}
export type TranscriptDividerLabelProps = ComponentProps<"span"> & { style?: CSSProperties & TranscriptDividerKnobStyle };
export function TranscriptDividerLabel({ className, ...props }: TranscriptDividerLabelProps) { return ( <span data-control-ui="transcript-divider" data-control-family="transcript-divider" data-slot="label" className={cn("min-w-0 text-center text-pretty", className)} {...props} /> );}
Knobs
Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.
| Knob | Syntax | Default |
|---|---|---|
--cui-transcript-divider-foreground | <color> | var(--muted-foreground) |
--cui-transcript-divider-line-color | <color> | var(--border) |
--cui-transcript-divider-danger-foreground | <color> | var(--destructive-text) |
--cui-transcript-divider-success-foreground | <color> | var(--success-text) |
--cui-transcript-divider-warning-foreground | <color> | var(--warning-text) |