Lenra Docs
Register on Lenra
  • Home
  • Getting started
    Open/Close
  • Guides
    Open/Close
  • Features
    Open/Close
  • References
    Open/Close
  • Contribute

    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

    AttributeDescriptionType
    _typeThe type of the element
    • text
    valuethe value displayed in the elementstring
    childrenAdditional texts to add after this text.array
    localeElement of type localeLocale
    semanticsLabelThe value to explain a different semanticsstring
    spellOutWhether the assistive technologies should spell out this text character by characterboolean
    styleThe style of the Text.TextStyle
    textAlignThe text alignment
    • left
    • center
    • right
    • justify
    • start
    • end