<Procedure>

<Procedure>

An ordered flow of <Step>s. The model sees the steps up to the current one and gets the advanceTool to move on (Step-by-step procedures).

import { Procedure } from "curb";

function Procedure(props: ProcedureProps): ReactNode;

Props

PropTypeDefaultWhat it does
titlestringThe flow’s name
advanceTool{ name, description?, onCall? }complete_procedure_stepThe tool that finishes a step. It takes no input, and an onCall replaces the built-in advance
completedReactNodeRendered once every step is done
onComplete() => voidRuns when the last step is done
initialStepnumber1Where it starts. Steps count from 1
currentStepnumberHolds the step yourself, with onStepChange
onStepChange(step) => voidRuns when the step changes

Example

<Procedure title="Report a claim" completed={<Tool name="submit_claim" description="File the claim." onCall={submit} />}>
  <Step title="Ask what happened">Ask what happened and when.</Step>
  <Step title="Ask for the policy number">Ask for the policy number.</Step>
</Procedure>

Version history

VersionChanges
v0.1.2<Procedure> introduced