Text
This is a typical text component.
This component has a children property in case some complex text needs to be done (see examples below).
Examples
Basic text
{
"type": "text",
"value": "This is a text.",
}
Complex text
This is an example involving a complex text. It is composed of bold and italic values all in one sentence.
{
"type": "text",
"value": "This is a text involving",
"children": [
{
"type": "text",
"value": "bold",
"style": {
"fontWeight": "bold",
},
},
{
"type": "text",
"value": "and",
},
{
"type": "text",
"value": "italic",
"style": {
"fontStyle": "italic",
},
},
{
"type": "text",
"value": "values.",
},
]
}
Properties
| Attribute | Description | Type |
|---|---|---|
| _type | The type of the element |
|
| value | the value displayed in the element | string |
| children | Additional texts to add after this text. | array |
| locale | Element of type locale | Locale |
| semanticsLabel | The value to explain a different semantics | string |
| spellOut | Whether the assistive technologies should spell out this text character by character | boolean |
| style | The style of the Text. | TextStyle |
| textAlign | The text alignment |
|