Skip to content

Commit 0a424aa

Browse files
authored
Merge pull request #3644 from Shopify/improve-admin-component-docs
Improve admin component documentation for common usage patterns
2 parents 386f418 + e21296c commit 0a424aa

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const data: AdminReferenceEntityTemplateSchema = {
1010
title: 'Best practices',
1111
type: 'Generic' as const,
1212
anchorLink: 'best-practices',
13-
sectionContent: `- Work independently from each other
13+
sectionContent: `- Use ChoiceList when rendering multiple checkboxes to provide a consistent and accessible selection interface
14+
- Work independently from each other
1415
- Be framed positively (e.g., "Publish store" not "Hide store")
1516
- Always have a label when used to activate or deactivate a setting
1617
- Be listed in a logical order (alphabetical, numerical, time-based, etc.)`,

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ import gridItemSharedContent from '../../../../docs/shared/components/GridItem';
55
const data: AdminReferenceEntityTemplateSchema = {
66
...sharedContent,
77
subSections: [
8+
{
9+
title: 'Best practices',
10+
type: 'Generic' as const,
11+
anchorLink: 'best-practices',
12+
sectionContent: `- Always configure layout properties when using Grid. At minimum, set gridTemplateColumns to define your column structure (e.g., repeat(12, 1fr) for a 12-column grid)
13+
- Use gap to add spacing between grid items rather than adding margins to individual items
14+
- Combine gridTemplateColumns with gridColumn on GridItem components to control how items span across columns`,
15+
},
816
{
917
title: 'Useful for',
1018
type: 'Generic' as const,

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ const data: AdminReferenceEntityTemplateSchema = {
66
thumbnail:
77
'/assets/templated-apis-screenshots/admin/components/searchfield.png',
88
isVisualComponent: true,
9+
subSections: [
10+
{
11+
title: 'Best practices',
12+
type: 'Generic' as const,
13+
anchorLink: 'best-practices',
14+
sectionContent: `- The SearchField automatically includes a clear button when text is entered, so you should not create your own clear button`,
15+
},
16+
],
917
definitions: [
1018
{
1119
title: 'SearchField',

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const data: AdminReferenceEntityTemplateSchema = {
1717
title: 'Best practices',
1818
type: 'Generic' as const,
1919
anchorLink: 'best-practices',
20-
sectionContent: `- Use plain and clear terms.
20+
sectionContent: `- Text elements display inline and will flow on the same line when placed next to each other. To stack multiple text elements vertically, wrap them in a Stack container or use multiple \`s-paragraph\` components.
21+
- Use plain and clear terms.
2122
- Don't use jargon or technical language.
2223
- Don't use different terms to describe the same thing.
2324
- Don't duplicate content.`,

0 commit comments

Comments
 (0)