The Toast API allows the display of a Toast component.
Show a toast.
The Toast API allows the display of a Toast component.
import React from 'react';
import {
Tile,
useApi,
reactExtension,
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title="My App"
onPress={() => api.toast.show('Toast content', 5000)}
enabled
/>
);
};
export default reactExtension('pos.home.tile.render', () => <SmartGridTile />);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
onPress: () => api.toast.show('Toast content', 5000),
enabled: true,
});
root.append(tile);
});
import React from 'react';
import {
Tile,
useApi,
reactExtension,
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title="My App"
onPress={() => api.toast.show('Toast content', 5000)}
enabled
/>
);
};
export default reactExtension('pos.home.tile.render', () => <SmartGridTile />);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
onPress: () => api.toast.show('Toast content', 5000),
enabled: true,
});
root.append(tile);
});