Skip to content

Commit 7a2f0f4

Browse files
authored
Merge pull request #3676 from Shopify/cappslock/chore/2026-01-rc/update-toast-API-docs
Update Toast API docs
2 parents 60a6c85 + 8076704 commit 7a2f0f4

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

packages/ui-extensions/docs/surfaces/point-of-sale/reference/apis/toast-api.doc.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const generateJsxCodeBlockForToastApi = (title: string, fileName: string) =>
77
const data: ReferenceEntityTemplateSchema = {
88
name: 'Toast API',
99
description:
10-
"The Toast API provides temporary notification functionality for POS UI extensions, allowing you to display brief, non-intrusive messages to users for feedback, confirmations, and status updates that automatically disappear after a specified duration. Toast messages appear as overlay notifications that don't interrupt the user's workflow.",
10+
"The Toast API provides temporary notification functionality for POS UI extensions, allowing you to display brief, non-intrusive messages to users for feedback, confirmations, and status updates that automatically disappear. Toast messages appear as overlay notifications that don't interrupt the user's workflow.",
1111
isVisualComponent: false,
1212
type: 'APIs',
1313
definitions: [
@@ -27,7 +27,6 @@ const data: ReferenceEntityTemplateSchema = {
2727
title: 'Best practices',
2828
sectionContent: `
2929
- **Write clear, concise messages:** Keep content brief since toasts disappear automatically.
30-
- **Use appropriate timing:** Choose durations that give users enough time to read without keeping visible too long.
3130
- **Provide meaningful feedback:** Use toasts to confirm actions, explain errors, or communicate status changes.
3231
- **Avoid overuse:** Reserve for important feedback. Don't show multiple toasts simultaneously.
3332
- **Handle multiple toast messages:** Multiple toast messages may overlap or interfere with each other if shown in rapid succession. Consider queuing or spacing out notifications appropriately.
@@ -53,7 +52,7 @@ Toast content is limited to plain text and can't include rich formatting, links,
5352
'show',
5453
),
5554
description:
56-
"Display a toast notification from a tile. This example demonstrates using `shopify.toast.show()` to display a brief, non-intrusive message that automatically disappears after a specified duration. This is useful for confirmations, status updates, or success messages that don't require user interaction.",
55+
"Display a toast notification from a tile. This example demonstrates using `shopify.toast.show()` to display a brief, non-intrusive message that automatically disappears. This is useful for confirmations, status updates, or success messages that don't require user interaction.",
5756
},
5857
],
5958
},

packages/ui-extensions/src/surfaces/point-of-sale/api.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@ export type {
7373

7474
export type {StorageApi} from './api/storage-api/storage-api';
7575

76-
export type {
77-
ShowToastOptions,
78-
ToastApiContent,
79-
ToastApi,
80-
} from './api/toast-api/toast-api';
76+
export type {ToastApiContent, ToastApi} from './api/toast-api/toast-api';
8177

8278
// Type exports
8379
export type {

packages/ui-extensions/src/surfaces/point-of-sale/api/toast-api/toast-api.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
1-
/**
2-
* Specifies configuration options for displaying toast notifications. Controls the duration and display behavior of temporary notification messages.
3-
*/
4-
export interface ShowToastOptions {
5-
/**
6-
* The duration in milliseconds that the toast message should remain visible before automatically dismissing. If not specified, the toast will use the default system duration. Use shorter durations for simple confirmations and longer durations for important messages that users need time to read.
7-
*/
8-
duration?: number;
9-
}
10-
111
export interface ToastApiContent {
122
/**
133
* Displays a toast notification with the specified text content. The message appears as a temporary overlay that automatically dismisses after the specified duration. Use for providing immediate user feedback, confirming actions, or communicating status updates without interrupting the user's workflow.
144
*
155
* @param content The text content to display.
16-
* @param options An object containing ShowToastOptions.
176
*/
18-
show: (content: string, options?: ShowToastOptions) => void;
7+
show: (content: string) => void;
198
}
209

2110
/**

0 commit comments

Comments
 (0)