Skip to content

Function: success()

ts
function success(ctx: Context, options: SuccessOptions): Promise<{
  data: Record<string, any>;
  button: string;
}>;

Defined in: src/renderer/templates/success.ts:75

Displays a success notification with feedback collection.

Shows confetti animation, completion message, and thumbs up/down feedback. Localized for English and German. Sends telemetry events.

Parameters

ParameterTypeDescription
ctxContextRender context with telemetry and language settings
optionsSuccessOptionsSuccess UI configuration

Returns

Promise<{ data: Record<string, any>; button: string; }>

Promise resolving when dismissed

Examples

ts
import {success} from '@matterway/sdk/UI';

await success(ctx, {
  title: 'Export Complete',
  text: 'Report generated successfully.',
  statusList: [
    {label: '1,247 records processed', value: 'success'},
    {label: 'Saved to Downloads', value: 'success'}
  ]
});

Usage with callout in text

ts
await success(ctx, {
  title: 'Task Complete',
  text: ':::info\nAll items have been processed.\n:::\nYou may now close the assistant.'
});

Matterway Assistant SDK Documentation