SDK
Event Handlers
All Frigade components come with a series of event handlers. They are all prefixed with on
and then the name of the event. For example, the onButtonClick
handler in the <FrigadeChecklist />
component is called when a user clicks on a button as such:
<FrigadeChecklist
flowId='flow_laJhda4sgJCdsCy6'
onButtonClick={(
step: StepData,
index?: number,
cta?: 'primary' | 'secondary' | 'link',
nextStep?: StepData
) => {
if (step.id === 'my-step-id') {
// Take some action
}
// Returning true dismisses the checklist if it runs in a modal.
return true;
}}
type='modal'
checklistStyle='default'
/>
To see a full list of event handlers for each component, see the Props section of each component’s documentation.