Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How do I include a blank line in a text or textblock component?

Solved

How do I include a blank line in a text or textblock component?

Schmidtc63
Shopify Partner
101 14 29

I need to include a blank line in some text. Of course br does not work as Shopify has seen fit to not allow this.

 

 

 

    const tooltip = root.createComponent(
        Tooltip,
        {},
        [
            root.createComponent(TextBlock, {}, `We've got you covered! By opting in to our package protection, you will be ensured that your package will arrive to you in excellent condition or your money back!     `),
            root.createComponent(TextBlock, {}, ` `),
            root.createComponent(TextBlock, {}, ` `),
            root.createComponent(TextBlock, {}, `KicKee's package protection covers lost,stolen or damaged packages.`),
            link2
        ]
    );

 

 
What this renders is no blank line.
 
This renders separate lines but I don't want to see the "-----":

 

    const tooltip = root.createComponent(
        Tooltip,
        {},
        [
            root.createComponent(TextBlock, {}, `We've got you covered! By opting in to our package protection, you will be ensured that your package will arrive to you in excellent condition or your money back!     `),
            root.createComponent(TextBlock, {}, `-----`),
            root.createComponent(TextBlock, {}, `-----`),
            root.createComponent(TextBlock, {}, `KicKee's package protection covers lost,stolen or damaged packages.`),
            link2
        ]
    );

 

Accepted Solution (1)

Schmidtc63
Shopify Partner
101 14 29

This is an accepted solution.

root.createComponent(BlockSpacer, {spacing: 'loose'}),

View solution in original post

Reply 1 (1)

Schmidtc63
Shopify Partner
101 14 29

This is an accepted solution.

root.createComponent(BlockSpacer, {spacing: 'loose'}),