Skip to content

Commit bfa984b

Browse files
authored
Merge pull request #3660 from Shopify/ag/text-icon-badge-docs-warning
[Docs] Update Text component docs: Add warning about nesting Icon/Badge
2 parents 75d71eb + 76c95c7 commit bfa984b

File tree

1 file changed

+3
-0
lines changed
  • packages/ui-extensions/src/surfaces/point-of-sale/components/Text

1 file changed

+3
-0
lines changed

packages/ui-extensions/src/surfaces/point-of-sale/components/Text/Text.doc.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const data: ReferenceEntityTemplateSchema = {
4242
- **Apply appropriate tones:** Use \`success\` for positive outcomes, \`warning\` or \`critical\` for alerts, \`info\` for helpful context, \`auto\` for neutral content.
4343
- **Balance color intensity:** Use \`strong\` for emphasis, \`base\` for readability, \`subdued\` for secondary info.
4444
- **Nest for mixed formatting:** Nest \`Text\` components when you need multiple styles within one text block.
45+
- **Use Stack for icons and badges:** When combining text with icons or badges, use Stack with direction="inline" instead of nesting components inside Text.
4546
`,
4647
},
4748
{
@@ -50,6 +51,8 @@ const data: ReferenceEntityTemplateSchema = {
5051
title: 'Limitations',
5152
sectionContent: `
5253
Complex rich text formatting isn't supported—use multiple \`Text\` components or nested text elements for varied formatting needs.
54+
55+
Nesting Icon or Badge components inside Text isn't supported due to React Native alignment limitations—use Stack with direction="inline" and alignItems="center" instead to properly align icons and badges with text.
5356
`,
5457
},
5558
],

0 commit comments

Comments
 (0)