The showFlag
bridge method enables UI Kit and custom UI apps to open flags in the product's flag group.
1 2function showFlag(flagOptions: FlagOptions): { close: () => Promise<boolean | void> }; interface FlagOptions { id: string; title?: string; description?: string; type?: 'info' | 'success' | 'warning' | 'error'; appearance?: 'info' | 'success' | 'warning' | 'error'; actions?: FlagAction[]; isAutoDismiss?: boolean; } interface FlagAction { text: string; onClick: () => void; }
true
, the flag will automatically close after 8 seconds.close
function.1 2import { showFlag } from '@forge/bridge'; const flag = showFlag({ id: 'success-flag', title: 'Hello World!', type: 'info', description: 'Here is a flag body description.', actions: [ { text: 'Flag action', onClick: () => { console.log('flag action clicked'); }, } ], isAutoDismiss: true, }); flag.close();
Rate this page: