Skip to content

Commit 76c95c7

Browse files
armaan-ghoshcappslock
authored andcommitted
Update Text component docs: Add warning about nesting Icon/Badge
- Add best practice: Use Stack for icons and badges instead of nesting - Add limitation: Explain React Native alignment issue with nested Icon/Badge - Provide Stack with direction='inline' as recommended alternative Addresses #21094
1 parent 75d71eb commit 76c95c7

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)