Single Pane Chat Stepper
The Single Pane Chat Stepper (SinglePaneStepperV2) is a single-column guided flow for conversational setup. It keeps the vertical stepper timeline from the original Single Pane Stepper — checkmarks, connectors, and step badges — but completed answers render as chat messages.
After a step is completed, the form is not collapsed into an accordion. The question stays in the timeline as the step header, and the selection appears as a user MessageBubble with edit, copy, and a timestamp.
Use the Single Pane Chat Stepper for onboarding and PLG flows where the thread of answers should read like a conversation.
What changed from Single Pane Stepper
| Single Pane Stepper | Single Pane Chat Stepper |
|---|---|
| Completed card content collapses in an accordion under the step | Completed card content is replaced by a chat message |
| Restart lives in the step header / accordion chrome | Edit and copy live on the message footer |
Same FlowConfig + useFlowCard engine as the dual pane stepper | Same FlowConfig and useFlowCard API in this repo |
Interactive Example
This example walks through creating a first feature flag. Complete a step to see the answer land as a chat message. Hide inactive steps to drop the upcoming questions and fade the active connector out.
Usage
import { SinglePaneStepperV2, useFlowCard } from "@harnessio/ui/components";import type { FlowConfig } from "@harnessio/ui/components";
function GoalCard() { const { complete } = useFlowCard();
return ( <SinglePaneStepperV2.Card title="What do you want your first flag to do?" description="In a sentence or two, describe what functionality you want your first feature flag to control." > <textarea /> <button onClick={() => complete({ answer: "Switch a Sign Up button from blue to green, or change its copy, for a subset of users.", }) } > Continue </button> </SinglePaneStepperV2.Card> );}
const flow: FlowConfig = { steps: { goal: { title: "What do you want your first flag to do?", component: GoalCard, next: "targeting", }, targeting: { title: "Who should see the new experience?", component: TargetingCard, }, }, initialStep: "goal",};
<SinglePaneStepperV2.Root flow={flow} contentTitle="Create your first feature flag"/>Anatomy
<SinglePaneStepperV2.Root flow={flowConfig}> {/* Cards are rendered automatically from flow.steps */}</SinglePaneStepperV2.Root>Cards still use useFlowCard to complete, skip, error, or open drawers:
function MyCard() { const { complete } = useFlowCard();
return ( <SinglePaneStepperV2.Card title="Choose an option"> <button onClick={() => complete({ answer: "Option A" })}>Option A</button> </SinglePaneStepperV2.Card> );}Chat answers
Pass a string answer in complete() so the message survives remounts and back-navigation:
complete({ provider: "github", answer: "GitHub" });You can also pass answer on the card. The card resolves display text in this order:
- The
answerprop onSinglePaneStepperV2.Card answerstored on the completed history entrystateSnapshot.answer
An empty string is not a chat message. It falls through to the next source, and complete({ answer: "" }) does not store one.
answer is also merged into the shared engine state, and every later complete() overwrites state.answer. Treat answer as reserved for this chat message. Keep domain values on their own keys (goal, audience).
complete() only leaves answer on this step’s snapshot when this call passed a non-empty string. A completed step with no answer of its own stays silent instead of repeating the previous message. stateSnapshot.answer is still the third display source for a resumed history entry that stored the message there.
When a step is active or errored, the card renders children (the form). When it is completed, children are not shown. A resolved answer renders as the chat message; if there is no answer, the card renders the question header and nothing else. There is no accordion expand/collapse for the completed question.
A skipped step shows “Skipped” and, when a later step is still in the thread, the same go-back control as a completed message. The timeline indicator can also go back.
Upcoming steps that have not been visited use the title on FlowConfig. Visited cards use the title prop on SinglePaneStepperV2.Card. Root children render inside the engine provider, same as v1, for host overlays.
onComplete runs only when complete() is called on a step that is already terminal and has no next. That path does not store answer or completedAt, so a last step flagged terminal cannot both notify the host and become a chat message. Leave the last step unflagged and pass answer from complete() to show the message. onComplete does not run for that first completion.
Completed messages include:
- Edit — reactivates the step after the same confirmation dialog used by the other steppers
- Copy — copies the answer text
- Timestamp — local time from when
complete()ran
Root
Prop | Required | Default | Type |
|---|---|---|---|
| flow | true | FlowConfig | |
| icon | false | ReactNode | |
| title | false | string | |
| stepperTitle | false | string | |
| showStepperHeader | false | boolean | |
| contentTitle | false | string | |
| contentSubtitle | false | string | |
| drawers | false | Record<string, ComponentType<DrawerComponentProps>> | |
| onComplete | false | (state: Record<string, unknown>) => void | |
| onReactivate | false | (stepId: string) => void | |
| initialEngineState | false | InitialEngineState | |
| disableAutoScroll | false | boolean | |
| onClose | false | () => void | |
| showRootHeader | false | boolean | |
| hideHeader | false | boolean | |
| reactivationPrompt | false | ReactivationPrompt | |
| showStepBadge | false | boolean | |
| showInactiveSteps | false | boolean | |
| className | false | string | |
| children | false | ReactNode |
Card
Prop | Required | Default | Type |
|---|---|---|---|
| title | true | string | |
| description | false | string | |
| answer | false | string | |
| children | true | ReactNode | |
| className | false | string |
Best practices
- Always send
answerfromcomplete()with a human-readable label, not a raw id ("A subset of users"instead of"subset"). - Keep one question per card so the thread stays readable.
- Do not rebuild accordion or completed-form UI inside the card — the Single Pane Chat Stepper owns the completed state.
- Use the Single Pane Chat Stepper (
SinglePaneStepperV2) for conversational setup. UseSplitPaneStepperwhen users need a persistent rail and a larger workspace.
Accessibility
- Active steps use
aria-current="step" - Completed indicators are buttons that request reactivation
- Message edit is labeled
Edit this answer - Copy uses the existing
CopyButtoncontrol - The go-back confirmation dialog is the same warning
AlertDialogused by the other steppers