Appearance
Function: showHighlight()
ts
function showHighlight(ctx: Context, options: ShowHighlightOptions): Promise<string>;Defined in: src/highlight/showHighlight.tsx:47
Display a highlight on elements and show a form overlay.
Highlight the target elements, present a form with buttons, and wait for the user to click one. All highlights are removed after the form resolves.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | Context object. |
options | ShowHighlightOptions | Highlight and form configuration. |
Returns
Promise<string>
The value of the button that was clicked.
Example
ts
const button = await showHighlight(ctx, {
selectors: ['.order-total', '.tax-line'],
color: '#ff5722',
buttons: [
{ text: 'Looks good', value: 'ok' },
{ text: 'Fix it', value: 'fix' },
],
title: 'Review order',
description: 'Check the highlighted totals before submitting.',
text: 'Order total',
});