Skip to content

Commit 9a27667

Browse files
authored
Merge pull request #3557 from Shopify/add-more-examples-to-admin-page
Add breadcrumbs and secondary actions examples to Page component
2 parents 78318cc + f07bc27 commit 9a27667

File tree

5 files changed

+71
-0
lines changed

5 files changed

+71
-0
lines changed

packages/ui-extensions/src/surfaces/admin/components/Page/Page.ab.doc.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,47 @@ const data: AdminReferenceEntityTemplateSchema = {
106106
],
107107
},
108108
},
109+
{
110+
description:
111+
'Shows a page with breadcrumb navigation and a descriptive heading, helping users understand their location in the navigation hierarchy.',
112+
codeblock: {
113+
title: 'Page with breadcrumbs and title',
114+
tabs: [
115+
{
116+
code: './examples/page-with-breadcrumbs-and-title.html',
117+
language: 'html',
118+
layout: 'none',
119+
},
120+
{
121+
code: './examples/page-with-breadcrumbs-and-title.jsx',
122+
language: 'preview-jsx',
123+
layout: 'none',
124+
},
125+
],
126+
},
127+
},
128+
{
129+
description:
130+
'Demonstrates a page with a primary action button and secondary action buttons, showing how to provide main and related actions alongside the page heading.',
131+
codeblock: {
132+
title: 'Page with primary and secondary actions',
133+
tabs: [
134+
{
135+
code: './examples/page-with-secondary-actions.html',
136+
language: 'html',
137+
layout: 'none',
138+
},
139+
{
140+
code: './examples/page-with-secondary-actions.jsx',
141+
language: 'preview-jsx',
142+
layout: 'none',
143+
customStyles: {
144+
minHeight: '400px',
145+
},
146+
},
147+
],
148+
},
149+
},
109150
],
110151
},
111152
],
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<s-page heading="Edit Product" inline-size="base">
2+
<s-link slot="breadcrumb-actions" href="/products">Products</s-link>
3+
<s-link slot="breadcrumb-actions" href="/products/123">Acme Widget</s-link>
4+
<s-section>
5+
<s-text>Update your product information and settings.</s-text>
6+
</s-section>
7+
</s-page>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<s-page heading="Edit Product" inlineSize="base">
2+
<s-link slot="breadcrumb-actions" href="/products">Products</s-link>
3+
<s-link slot="breadcrumb-actions" href="/products/123">Acme Widget</s-link>
4+
<s-section>
5+
<s-text>Update your product information and settings.</s-text>
6+
</s-section>
7+
</s-page>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<s-page heading="Products" inline-size="base">
2+
<s-button slot="secondary-actions">Preview</s-button>
3+
<s-button slot="secondary-actions">Duplicate</s-button>
4+
<s-button slot="primary-action" variant="primary">Save</s-button>
5+
<s-section>
6+
<s-text>Manage your products and organize your catalog.</s-text>
7+
</s-section>
8+
</s-page>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<s-page heading="Products" inlineSize="base">
2+
<s-button slot="secondary-actions">Preview</s-button>
3+
<s-button slot="secondary-actions">Duplicate</s-button>
4+
<s-button slot="primary-action" variant="primary">Save</s-button>
5+
<s-section>
6+
<s-text>Manage your products and organize your catalog.</s-text>
7+
</s-section>
8+
</s-page>

0 commit comments

Comments
 (0)