Embedded Experience Containers
Overviewβ
This documentation outlines the different types of containers supported by our widget and their respective capabilities. The widget can be configured to use either a primary container only or a combination of primary and secondary containers.
Container Typesβ
Primary Only Containersβ
Primary only containers mean that the entire widget usage is done within that primary container.
- Types:
inline,modal,drawer
Primary and Secondary Containersβ
Primary and secondary containers are used when the primary container is inline. This configuration allows the primary container to show the initial view of the session, while the secondary container is used for additional actions that are not part of the primary session capability.
- Primary Type:
inline - Secondary Types:
modal,drawer
Widget Capabilities by Container Typeβ
Primary onlyβ
| Inline | Modal | Drawer | |
|---|---|---|---|
| Payment with wallet | β | β | β |
| Payment | β | β | β |
| Wallet management | β | β | β |
| Add payment method | β | β | β |
| Payment method selector | β | β | β |
| Payment method display | β | β | β |
Primary (inline) and Secondary (modal, drawer)β
| Primary (inline) | Secondary (modal, drawer) |
|---|---|
| Payment method selector | Wallet management |
| Payment with wallet | Wallet management |
| Wallet Management |
|
Examplesβ
Here are a few examples to illustrate the combinations:
Example 1: Primary Only - Inlineβ
const options: OptumCCGWidgetInitializerParams = {
appEnv: "prod",
checkoutSessionId: "checkout-session-id",
rootElement: document.getElementById("ccgWidgetContainer")!,
containerConfig: {
type: "inline",
},
};
const ccgWidget = OptumCCGWidgetInitializer(options);
Example 2: Primary and Secondary - Inline with Drawerβ
const options: OptumCCGWidgetInitializerParams = {
appEnv: "prod",
checkoutSessionId: "checkout-session-id",
rootElement: document.getElementById("ccgWidgetContainer")!,
containerConfig: {
type: "inline",
secondaryContainer: {
type: "drawer",
},
},
};
const ccgWidget = OptumCCGWidgetInitializer(options);
Example 3: Primary and Secondary - Inline with Modalβ
const options: OptumCCGWidgetInitializerParams = {
appEnv: "prod",
checkoutSessionId: "checkout-session-id",
rootElement: document.getElementById("ccgWidgetContainer")!,
containerConfig: {
type: "inline",
secondaryContainer: {
type: "modal",
},
},
};
const ccgWidget = OptumCCGWidgetInitializer(options);
Example 4: Primary Only - How to Enable Auto Scroll for Inlineβ
const options: OptumCCGWidgetInitializerParams = {
appEnv: "prod",
checkoutSessionId: "checkout-session-id",
rootElement: document.getElementById("ccgWidgetContainer")!,
containerConfig: {
type: "inline",
autoScrollEnabled: true,
},
};
const ccgWidget = OptumCCGWidgetInitializer(options);