This package provides a set of React components and utilities for embedding and managing Confidence Playbooks in your application. All exports are available from the ConfidencePlaybook
module, with several specialized subcomponents for different integration scenarios.
The main component for rendering a playbook instance by its ID.
Props:
-
playbookInstanceId
(string | number): The unique instance ID of the playbook to display. -
playbookMode
("list" | "card"): Display mode for tasks. -
playbookStyle
(object, optional): White-label and overlay style configuration.
Example:
<ConfidencePlaybook
playbookInstanceId={12345}
playbookMode="list"
playbookStyle={{
overlay: { position: "right", size: { width: 500 } },
whiteLabel: { primaryColor: "#007BFF" },
}}
/>
Automatically initiates a playbook for a given user/email and playbook template, then renders the playbook UI once ready.
Props:
-
email
(string): The user's email to initiate the playbook for. -
playbookId
(string): The playbook template ID. -
playbookMode
("list" | "card"): Display mode for tasks.
Example:
<ConfidencePlaybook.AutoInstantiated
email="user@example.com"
playbookId="YOUR_PLAYBOOK_ID"
playbookMode="list"
/>
Renders a button that, when clicked, prompts the user for their email and then instantiates and displays the playbook.
Props:
-
playbookId
(string): The playbook template ID. -
playbookMode
("list" | "card", optional): Display mode for tasks (default: "list"). -
playbookStyle
(object, optional): White-label and overlay style configuration. -
btnLabel
(string, optional): Button label (default: "Start Playbook").
Example:
<ConfidencePlaybook.WithInstantiateButton
playbookId="YOUR_PLAYBOOK_ID"
btnLabel="Start Playbook"
playbookMode="card"
playbookStyle={{
overlay: { position: "right", size: { width: 500 } },
whiteLabel: { primaryColor: "#007BFF" },
}}
/>
A lower-level component for rendering a playbook UI given a playbook object. Useful for advanced scenarios or custom data sources.
Props:
-
playbook
(Playbook): The playbook data object. -
playbookMode
("list" | "card"): Display mode for tasks. -
onTaskButtonClick
(function): Handler for task button actions. -
playbookStyle
(object, optional): White-label and overlay style configuration.
Example:
<ConfidencePlaybook.View
playbook={playbookData}
playbookMode="list"
onTaskButtonClick={async (btn, taskId) => {
// handle action
}}
/>
- All components are styled with TailwindCSS and scoped under
.confidence-ui
. - For more details on the
playbookStyle
prop and available options, see the source code or type definitions. - These exports are designed for flexibility: use the high-level components for quick integration, or the lower-level
View
for custom scenarios.