Sabil UI

Search documentation

Search for a command to run...

Components

Trace

Shows the steps an agent or a job takes, with live status.

Searched the codebase for “checkout”
app/checkout/page.tsxlib/cart.tslib/payments.ts
Updated the total calculationRunning the test suite

Installation#

  1. Install the dependencies

    npm install cn lucide-react radix-ui
  2. Copy the source into your project

    components/ui/trace.tsx
    import * as React from "react"import { cn } from "cn"import {  Collapsible,  CollapsibleContent,  CollapsibleTrigger,} from "@/components/ui/collapsible"import { ChevronRightIcon } from "lucide-react"function Trace({ className, ...props }: React.ComponentProps<"div">) {  return (    <div      data-slot="trace"      className={cn(        "flex w-full min-w-0 flex-col gap-2 *:has-[>[data-slot=trace-line]]:flex *:has-[>[data-slot=trace-line]]:w-fit *:has-[>[data-slot=trace-line]]:max-w-full *:has-[>[data-slot=trace-line]]:min-w-0 *:has-[>[data-slot=trace-line]]:rounded-md *:has-[>[data-slot=trace-line]]:text-left *:has-[>[data-slot=trace-line]]:outline-none *:has-[>[data-slot=trace-line]]:focus-visible:ring-3 *:has-[>[data-slot=trace-line]]:focus-visible:ring-ring/50",        className      )}      {...props}    />  )}function TraceLine({  className,  status,  ...props}: React.ComponentProps<"span"> & {  status?: "running" | "error" | "pending"}) {  return (    <span      data-slot="trace-line"      data-status={status}      className={cn(        "flex w-fit max-w-full min-w-0 items-center gap-2 text-sm text-muted-foreground transition-colors in-[a,button]:cursor-pointer in-[a:hover,button:hover]:text-foreground data-[status=error]:text-destructive data-[status=error]:in-[a:hover,button:hover]:text-destructive data-[status=pending]:opacity-60 data-[status=running]:*:data-[slot=trace-title]:shimmer",        className      )}      {...props}    />  )}function TraceIcon({ className, ...props }: React.ComponentProps<"span">) {  return (    <span      data-slot="trace-icon"      aria-hidden="true"      className={cn(        "flex size-4 shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=trace-title]~&]:-ml-1",        className      )}      {...props}    />  )}function TraceTitle({ className, ...props }: React.ComponentProps<"span">) {  return (    <span      data-slot="trace-title"      className={cn("min-w-0 truncate motion-reduce:shimmer-none", className)}      {...props}    />  )}function TraceDescription({  className,  ...props}: React.ComponentProps<"span">) {  return (    <span      data-slot="trace-description"      className={cn(        "shrink-0 text-muted-foreground/70 tabular-nums",        className      )}      {...props}    />  )}function TraceCollapsible({  className,  ...props}: Omit<React.ComponentProps<typeof Collapsible>, "asChild" | "open"> &  (    | { open?: undefined }    | {        open: boolean        onOpenChange: NonNullable<          React.ComponentProps<typeof Collapsible>["onOpenChange"]        >      }  )) {  return (    <Collapsible      data-slot="trace-collapsible"      className={cn("flex w-full min-w-0 flex-col", className)}      {...props}    />  )}function TraceCollapsibleTrigger({  className,  children,  ...props}: Omit<React.ComponentProps<typeof CollapsibleTrigger>, "asChild">) {  return (    <CollapsibleTrigger      data-slot="trace-collapsible-trigger"      className={cn(        "group/trace-collapsible-trigger flex w-fit max-w-full min-w-0 cursor-pointer items-center gap-1 rounded-md text-left text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 has-[[data-status=error]]:text-destructive",        className      )}      {...props}    >      {children}      <TraceIcon className="transition-transform group-aria-expanded/trace-collapsible-trigger:rotate-90">        <ChevronRightIcon        />      </TraceIcon>    </CollapsibleTrigger>  )}function TraceCollapsibleContent({  className,  children,  ...props}: Omit<React.ComponentProps<typeof CollapsibleContent>, "asChild">) {  return (    <CollapsibleContent      data-slot="trace-collapsible-content"      className="min-w-0 overflow-hidden duration-200 [--radix-accordion-content-height:var(--radix-collapsible-content-height)] data-open:animate-accordion-down data-closed:animate-accordion-up"      {...props}    >      <div        data-slot="trace-collapsible-content-inner"        className={cn(          "mt-2 mb-1 ml-[calc(--spacing(2)-1px)] min-w-0 border-l pr-1 pl-4 leading-relaxed wrap-break-word text-muted-foreground",          className        )}      >        {children}      </div>    </CollapsibleContent>  )}export {  Trace,  TraceLine,  TraceIcon,  TraceTitle,  TraceDescription,  TraceCollapsible,  TraceCollapsibleTrigger,  TraceCollapsibleContent,}
    components/ui/collapsible.tsx
    "use client"import { Collapsible as CollapsiblePrimitive } from "radix-ui"function Collapsible({  ...props}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {  return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />}function CollapsibleTrigger({  ...props}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {  return (    <CollapsiblePrimitive.CollapsibleTrigger      data-slot="collapsible-trigger"      {...props}    />  )}function CollapsibleContent({  ...props}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {  return (    <CollapsiblePrimitive.CollapsibleContent      data-slot="collapsible-content"      {...props}    />  )}export { Collapsible, CollapsibleTrigger, CollapsibleContent }
  3. Make sure the foundation is in place

    Components read their colors, radius and surfaces from the tokens in app/globals.css. See Theming.

Usage#

import {  Trace,  TraceLine,  TraceIcon,  TraceTitle,  TraceDescription,  TraceCollapsible,  TraceCollapsibleTrigger,  TraceCollapsibleContent,} from "@/components/ui/trace"

Examples#

Collapsible

Commit

Description

Edited components/settings/notification-preferences-form.tsx+48 −12Ran pnpm test14sSearched for useChat8 results

Dialog

Group

Searched for minimumReleaseAgeRead pnpm-workspace.yamlRan pnpm install

Open

$ node --version
v24.18.0

Sheet

Static

Created branch fix/frozen-lockfile

Status

Ran pnpm installFailed to run pnpm lintRunning pnpm buildRun pnpm test

Steps

Read the last twelve deploys

Turn

Ran node --version

Node is installed and pnpm is not. Reading the docs config.