Thinking
Read the order history (done)
14 orders since March
Compare roast preferences (done)
Mostly light, two medium
Pick three new coffees (active)
Write the recommendation (pending)
import { ThinkingTrace } from '@brand-studio/ui';
export default function ThinkingTraceDemo() {
return (
<div style={{ width: '100%', maxWidth: 480 }}>
<ThinkingTrace
defaultOpen
steps={[
{ id: 'read', title: 'Read the order history', detail: '14 orders since March', status: 'done' },
{ id: 'compare', title: 'Compare roast preferences', detail: 'Mostly light, two medium', status: 'done' },
{ id: 'pick', title: 'Pick three new coffees', status: 'active' },
{ id: 'write', title: 'Write the recommendation', status: 'pending' },
]}
/>
</div>
);
}Installation
pnpm add @brand-studio/uinpm install @brand-studio/uiyarn add @brand-studio/uibun add @brand-studio/uiInstall the peer dependencies
npm install react react-domImport the stylesheet once
import '@brand-studio/ui/styles.css';Wrap your app in a brand theme
import { BrandTheme, ThinkingTrace } from '@brand-studio/ui'; import brand from './brand.json'; <BrandTheme palette={brand.tokens} mode="system"> {/* your app */} </BrandTheme>
Usage
import { ThinkingTrace } from '@brand-studio/ui';<ThinkingTrace
steps={[
{ id: 'read', title: 'Read the order history', status: 'done' },
{ id: 'pick', title: 'Pick three coffees', status: 'active' },
]}
/>Examples
Finished
When no step is active, the summary counts the steps and the trace starts closed.
Thought through 3 steps
Read the order history (done)
Compare roast preferences (done)
Pick three new coffees (done)
import { ThinkingTrace } from '@brand-studio/ui';
export default function ThinkingTraceFinished() {
return (
<div style={{ width: '100%', maxWidth: 480 }}>
<ThinkingTrace
steps={[
{ id: 'read', title: 'Read the order history', status: 'done' },
{ id: 'compare', title: 'Compare roast preferences', status: 'done' },
{ id: 'pick', title: 'Pick three new coffees', status: 'done' },
]}
/>
</div>
);
}Accessibility
- Built on
<details>, so it opens with Enter or Space and works before JavaScript loads. - Each step's status is spelled out for screen readers.
API Reference
| Prop | Type | Default |
|---|---|---|
steps | TraceStep[] | – |
title? | string | – |
defaultOpen? | boolean | false |
className? | string | '' |