Skip to content

Custom component

A step with a component renders any React element. The chatbot passes the steps, step, previousStep and triggerNextStep props to it, typed as CustomComponentProps. See Custom components for more.

  • steps has the rendered steps by id, so steps.name.value is the name typed by the user and steps.plan.value is the chosen plan.
  • The props are optional in CustomComponentProps, so the component reads them with optional chaining.
  • DOM elements like <div /> do not receive the props, use a component to read them.