app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames_rails

The custom_event_type prop allows you to specify custom events that will trigger the dialog’s initialization or control its behavior. This is especially useful when working with Turbo Frame updates where standard DOM events might not suffice.

The examples demonstrate two use cases:
1) Opening a dialog via custom event dispatch: The first example shows how to configure a dialog to listen for a specific custom event (dialogOpen). When this event is dispatched, the dialog will automatically open, making it easy to trigger the dialog from JavaScript or after Turbo Frame operations.
2) Controlling dialog button actions with custom events: The second example demonstrates how to set up a dialog that can have its confirm button triggered through external events (turboResponse). This pattern is useful when you need to programmatically confirm a dialog after some background operation completes.
3) Multiple custom events: The third example combines the first two to show how custom_event_type prop can support multiple event types separated by a comma.

For Turbo integration, you can use standard Turbo events like turbo:frame-load or turbo:submit-end as your custom_event_type to ensure the dialog responds properly after Turbo navigation or form submissions. The dialog component will listen for these events automatically.
The implementation handles various actions including ‘open’, ‘close’, ‘clickConfirm’, and ‘clickCancel’, making it flexible for different interaction patterns in your Turbo-enhanced application.