Use this component if you need to communicate to merchants in a prominent way.
import React from 'react';
import {
render,
Banner,
Paragraph,
} from '@shopify/ui-extensions-react/admin';
render('Playground', () => <App />);
function App() {
return (
<Banner title="Shipping rates changed" dismissible onDismiss={() => console.log('dismissed banner')}>
<Paragraph>Your store may be affected</Paragraph>
</Banner>
);
}
import {extend, Banner} from '@shopify/ui-extensions/admin';
extend('Playground', (root) => {
const banner = root.createComponent(Banner, {
title: 'Shipping rates changed',
dismissible: true,
onDismiss: () => console.log('dismissed banner')
}, 'Your store may be affected');
root.appendChild(banner);
});
Whether or not the banner can be dismissed
A unique identifier for the element.
Function invoked when the banner is dismissed
Sets the Primary action button of the container. This component must be a button component.
Sets the Secondary action button of the container. This component must be a button component.
Message to display inside the banner
Adjusts the color and icon of the banner
'info' | 'success' | 'warning' | 'critical' | 'default'