Use this component if you need to communicate to merchants in a prominent way.
import React from 'react';
import {
render,
Banner,
Text,
} from '@shopify/ui-extensions-react/admin';
render('Playground', () => <App />);
function App() {
return (
<Banner title="Shipping rates changed" dismissible onDismiss={() => console.log('dismissed banner')}>
<Text>Your store may be affected</Text>
</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);
});
Message to display inside the banner
Adjusts the color and icon of the banner
Whether or not the banner can be dismissed
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.
A unique identifier for the element.
'info' | 'success' | 'warning' | 'critical' | 'default'