How to add custom text on the checkout page in Magento 2?

If you want to add custom text on the checkout page you need to add code in the xml file and create custom html file

Create checkout_index_index.xml file in the below directory

app/design/design/Vendor/theme/Magento_Checkout/layout/checkout_index_index.xml

and add the below code in the checkout_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="sidebar" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="summary" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="totals" xsi:type="array">
                                                    <item name="children" xsi:type="array">

                                                        <item name="some_text" xsi:type="array">
                                                            <item name="sortOrder" xsi:type="string">35</item>
                                                            <item name="component"  xsi:type="string">uiComponent</item>
                                                            <item name="config" xsi:type="array">
                                                                <item name="template" xsi:type="string">Magento_Checkout/custom</item>
                                                            </item>
                                                        </item>

                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

Create another HTML file for showing the content in the directory: app/design/design/Vendor/theme/Magento_Checkout/web/template/custom.html

Add code in the HTML file that you want to show on the checkout page

// for example

<h1>This is a custom text for showing on the checkout page</h1>

How to add custom text on the checkout page in Magento 2?expoundsofttechsolution

ghb