Communication
Marker
An inline status or note: “Exploring files” shimmers while working, then the spinner pops into a check and the text rolls to “Explored 4 files”. Divider variant labels a break.
Examples and variants
Working, done, divider
Press Finish.
function MarkerStates() {
const [done, setDone] = useState(false)
return (
<div className="flex flex-col items-start gap-3">
<Marker status={done ? "done" : "working"} done="Explored 4 files">
Exploring files
</Marker>
<Marker variant="divider">Conversation compacted</Marker>
<Button size="sm" variant="secondary" onClick={() => setDone((d) => !d)}>
{done ? "Work again" : "Finish"}
</Button>
</div>
)
}Spec drawing
Measured from the live component at default density. Each code maps to the token that sets it; change the token and the drawing follows.
Install
With the CLI
The shadcn CLI only delivers files: it copies our code from the Isotopi registry into your project and installs the packages it uses. Add the foundation once, then the component.
npx shadcn@latest add https://isotopi.com/r/minimal.json
npx shadcn@latest add https://isotopi.com/r/marker.jsonBy hand
No CLI needed. Add the foundation once (see Getting started), then follow these steps. They include every component this one builds on.
Install the packages it uses.
Terminalnpm install cn lucide-reactCopy these 2 files to the same paths in your project. Imports use the
@/alias for your project root.components/ui/spinner.tsxspinner
components/ui/spinner.tsximport * as React from "react" import { CheckIcon } from "lucide-react" import { cn } from "cn" /* Spinner: a short, unknown wait. Three buoyant dots (or a ring). When the work succeeds, set done: the dots gather into the centre and pop into a check. Sizes follow the icon tokens. */ const sizes = { sm: "h-icon-sm", md: "h-icon-md", lg: "h-icon-lg" } function Spinner({ className, size = "md", variant = "dots", done = false, label = "Loading", ...props }: React.ComponentProps<"span"> & { size?: keyof typeof sizes /** dots (default), ring, wave, orbit, morph, typing. All resolve into the same check. */ variant?: "dots" | "ring" | "wave" | "orbit" | "morph" | "typing" done?: boolean label?: string }) { return ( <span role="status" data-slot="spinner" data-done={done || undefined} className={cn("spinner relative inline-flex items-center justify-center", sizes[size], className)} {...props} > <span className="sr-only">{done ? "Done" : label}</span> {variant === "dots" || variant === "typing" ? ( <span aria-hidden data-variant={variant} className="spinner-dots inline-flex h-full items-center gap-[0.2em]"> {[0, 1, 2].map((dot) => ( <span key={dot} className="spinner-dot aspect-square h-[28%] rounded-full bg-current" style={{ "--dot": dot } as React.CSSProperties} /> ))} </span> ) : variant === "wave" ? ( <span aria-hidden className="spinner-dots inline-flex h-full items-center gap-[0.15em]"> {[0, 1, 2, 3].map((bar) => ( <span key={bar} className="spinner-bar h-full w-[0.18em] rounded-full bg-current" style={{ "--dot": bar } as React.CSSProperties} /> ))} </span> ) : variant === "orbit" ? ( <span aria-hidden className="spinner-dots spinner-orbit relative aspect-square h-full"> <span className="absolute top-0 left-1/2 aspect-square h-[30%] -translate-x-1/2 rounded-full bg-current" /> </span> ) : variant === "morph" ? ( <span aria-hidden className="spinner-dots spinner-morph aspect-square h-[70%] bg-current" /> ) : ( <span aria-hidden className="spinner-ring aspect-square h-full rounded-full" /> )} <CheckIcon aria-hidden className="spinner-check absolute aspect-square h-full w-auto" strokeWidth={2.5} /> </span> ) } export { Spinner }components/ui/marker.tsxmarker
components/ui/marker.tsx"use client" import * as React from "react" import { CheckIcon, XIcon } from "lucide-react" import { cn } from "cn" import { Spinner } from "@/components/ui/spinner" /* Marker: an inline status or note in a conversation ("Thinking…", "Explored 4 files", "Conversation compacted"). While working, the text shimmers; when done, the spinner pops into its final icon and the text rolls to the past tense. variant="divider" centres a label between turns. (Thinking status is Marker status="working".) */ function Marker({ status = "idle", icon, children, done, variant = "inline", className, }: { status?: "idle" | "working" | "done" | "error" icon?: React.ReactNode /** Label while working, e.g. "Exploring files". */ children: React.ReactNode /** Label once done, e.g. "Explored 4 files". Rolls in. */ done?: React.ReactNode variant?: "inline" | "divider" className?: string }) { const finished = status === "done" || status === "error" const mark = status === "working" ? ( <Spinner size="sm" label="Working" /> ) : status === "done" ? ( <CheckIcon className="marker-pop size-(--size-icon-sm) text-(--color-success-fg)" aria-hidden /> ) : status === "error" ? ( <XIcon className="marker-pop size-(--size-icon-sm) text-(--color-danger-fg)" aria-hidden /> ) : ( icon ) return ( <div role="status" data-slot="marker" data-status={status} data-variant={variant} className={cn( "flex items-center gap-2 text-sm text-(--marker-label)", variant === "divider" && "justify-center", className )} > <span className={cn("inline-flex items-center gap-2", variant === "divider" && "rounded-(--shape-full) bg-(--marker-divider) px-3 py-1 text-caption")}> {mark ? <span className="inline-flex shrink-0 [&_svg]:size-(--size-icon-sm)">{mark}</span> : null} <span className="relative inline-grid overflow-hidden"> <span data-position={finished && done ? "above" : "at"} className={cn("label-roll col-start-1 row-start-1", status === "working" && "marker-shimmer")}> {children} </span> {done ? ( <span data-position={finished ? "at" : "below"} aria-hidden={!finished} className="label-roll col-start-1 row-start-1"> {done} </span> ) : null} </span> </span> </div> ) } export { Marker }
Imports
What the examples on this page import:
import { Attachment } from "@/components/ui/attachment"
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
import { Bubble, BubbleGroup, BubbleReactions } from "@/components/ui/bubble"
import { Button } from "@/components/ui/button"
import { CodeBlock } from "@/components/ui/code-block"
import { Marker } from "@/components/ui/marker"
import { Message, MessageAvatar, MessageContent, MessageFooter, MessageHeader } from "@/components/ui/message"
import { MessageScroller } from "@/components/ui/message-scroller"
import { PromptInput } from "@/components/ui/prompt-input"
import { Questionnaire } from "@/components/ui/questionnaire"
import { StreamingText } from "@/components/ui/streaming-text"
import { Trace, TraceItem } from "@/components/ui/trace"
import { VoiceInput } from "@/components/ui/voice-input"
import { tokenMs } from "@/lib/motion/token-ms"Anatomy
- 1Icon · Spinner while working; check or cross when finished.
- 2Label · --marker-label; shimmers while working; rolls to the done label.
- 3Divider pill · --marker-divider.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
status | "idle" | "working" | "done" | "error" | "idle" | State. |
children / done | ReactNode | — | Present tense / past tense. |
variant | "inline" | "divider" | "inline" | Layout. |
Tokens
Every visual spec is a component token in styles/tokens/components.css, pointing at a semantic token. Change a token to restyle the component; themes change the semantic layer.
| Token | Points to | Light | Dark |
|---|---|---|---|
--marker-label | var(--on-surface-variant) | oklch(0.45 0.01 95) | oklch(0.68 0 0) |
--marker-divider | var(--surface-container) | oklch(0.965 0.005 95) | oklch(0.12 0 0) |
Motion
| Trigger | What happens | Tokens |
|---|---|---|
| Done | Shimmer stops; icon pops; text rolls to the past tense. | --duration-shimmer, --spring-snappy |
Calm keeps the motion without overshoot. Still (and reduced motion) keeps a designed frame with no movement.
Accessibility
- role=status (polite).
Usage
Do
- Say what the agent is doing in plain words.
Don’t
- Don't use for full tool output (use Trace).
Code
"use client"
import * as React from "react"
import { CheckIcon, XIcon } from "lucide-react"
import { cn } from "cn"
import { Spinner } from "@/components/ui/spinner"
/*
Marker: an inline status or note in a conversation ("Thinking…",
"Explored 4 files", "Conversation compacted"). While working, the text
shimmers; when done, the spinner pops into its final icon and the text rolls
to the past tense. variant="divider" centres a label between turns.
(Thinking status is Marker status="working".)
*/
function Marker({
status = "idle",
icon,
children,
done,
variant = "inline",
className,
}: {
status?: "idle" | "working" | "done" | "error"
icon?: React.ReactNode
/** Label while working, e.g. "Exploring files". */
children: React.ReactNode
/** Label once done, e.g. "Explored 4 files". Rolls in. */
done?: React.ReactNode
variant?: "inline" | "divider"
className?: string
}) {
const finished = status === "done" || status === "error"
const mark =
status === "working" ? (
<Spinner size="sm" label="Working" />
) : status === "done" ? (
<CheckIcon className="marker-pop size-(--size-icon-sm) text-(--color-success-fg)" aria-hidden />
) : status === "error" ? (
<XIcon className="marker-pop size-(--size-icon-sm) text-(--color-danger-fg)" aria-hidden />
) : (
icon
)
return (
<div
role="status"
data-slot="marker"
data-status={status}
data-variant={variant}
className={cn(
"flex items-center gap-2 text-sm text-(--marker-label)",
variant === "divider" && "justify-center",
className
)}
>
<span className={cn("inline-flex items-center gap-2", variant === "divider" && "rounded-(--shape-full) bg-(--marker-divider) px-3 py-1 text-caption")}>
{mark ? <span className="inline-flex shrink-0 [&_svg]:size-(--size-icon-sm)">{mark}</span> : null}
<span className="relative inline-grid overflow-hidden">
<span data-position={finished && done ? "above" : "at"} className={cn("label-roll col-start-1 row-start-1", status === "working" && "marker-shimmer")}>
{children}
</span>
{done ? (
<span data-position={finished ? "at" : "below"} aria-hidden={!finished} className="label-roll col-start-1 row-start-1">
{done}
</span>
) : null}
</span>
</span>
</div>
)
}
export { Marker }