Skip to content

Instantly share code, notes, and snippets.

@hannachen
Created August 26, 2019 15:37
Show Gist options
  • Save hannachen/b1b47c3f6533a0ecd97e65648b8aab3f to your computer and use it in GitHub Desktop.
Save hannachen/b1b47c3f6533a0ecd97e65648b8aab3f to your computer and use it in GitHub Desktop.
App Bridge Title Bar: Create
import {TitleBar} from ‘@shopify/app-bridge/actions’;
// Create buttons
const saveButton = Button.create(app, { label: 'Save' });
const cancelButton = Button.create(app, { label: 'Cancel' });
// Setup title bar options
const titleBarOptions = {
title: 'My page title',
buttons: {
primary: saveButton,
secondary: [cancelButton],
},
};
// Create title bar
const myTitleBar = TitleBar.create(app, titleBarOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment