Skip to main content

Banner

Use this component if you need to communicate to merchants in a prominent way.

string

Message to display inside the banner

Adjusts the color and icon of the banner

boolean

Whether or not the banner can be dismissed

() => void

Function invoked when the banner is dismissed

RemoteFragment

Sets the Primary action button of the container. This component must be a button component.

RemoteFragment

Sets the Secondary action button of the container. This component must be a button component.

string

A unique identifier for the element.

Was this section helpful?

Simple Banner example

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>
);
}

Preview