TextBlock

The TextBlock UI component is a container designed to fill the entire available width of its parent, used to display full paragraphs or blocks of text.

Preview

TextBlock.jpg

Code example

render('Checkout::Dynamic::Render', (root) => {
return
<TextBlock>
Cozy up in style!
Snuggle-ready knit, 6 colors, 50 % OFF today—grab your new favorite sweater before stock melts away!
</TextBlock>;
});

TextBlockProps

tip

Optional properties are marked with a ? . Properties without a ? are required.

size?

extraSmall small base medium large extraLarge extraExtraLarge number Default: base
The font size. The line height is automatically set to 1.5 times the font size. For example, 10px/15px corresponds to font size 10px and line height 15px.
  • extraSmall: 10px/15px
  • small: 12px/18px
  • base: 14px/21px
  • medium: 16px/24px
  • large: 18px/27px
  • extraLarge: 24px/36px
  • extraExtraLarge: 28px/42px

Supports custom font sizes, such as 20. The maximum value is 48. Values exceeding this limit will default to base. For example:

render('Checkout::Dynamic::Render', (root) => { return <Text size={48}>Total</Text>; }); 

emphasis?

italic bold

Used to emphasize the text in the italic or bold formats.


id?

string

A unique identifier for the UI component. If this property is not set, the system will automatically generate a globally unique ID for this component.


appearance?

accent subdued info success warning critical string

Modify the color of the element. Supports custom colors, such as red or #ccc.


decoration

TextDecoration

Text decoration.


Type descriptions

TextDecoration

type TextDecoration = 'lineThrough'
  • lineThrough: Text strikethrough.
Was this article helpful to you?