Skip to main content
As an example let’s build a Free Shipping Progress Bar and we’ll include this custom component inside the Cart Summary slot.
Free Shipping Progress Bar Pn
The basic HTML strucuture of a Free Shipping Progress Bar looks something like this:
index.tsx
In order for you to not re-create the entire Cart Summary component, you can reuse the native Cart Summary as a children of your custom component, because the Cart Summary component is the default content of the Cart Sidebar Totalizer slot. You can declare a {children} component directly in the HTML of your custom component.
index.tsx
You can declare a children at the beginning or at the end of your custom component

Free Shipping Progress Bar - Full Example

In order to see the children feature in action let’s create the Free Shipping Progress Bar and after that make the changes to include the children component.
This tutorial assumes you are able to create a custom component and also know how to use the React Hooks available in our SDK.
1

Basic Free Shipping Progress Bar Component

Use this boilerplate as the base for your component
index.tsx
2

Declare the children type

The children is also a react component, so we must also declare it as an interface
index.tsx
3

Insert the children component in the HTML

Include the children in the HTML part of your component (as in the beginning of this tutorial)
index.tsx
4

Declare which native component is the children

You must have noticed that until know we don’t actually know what is the component that is the children.When you upload your component you’ll assign the component to a Slot, the native component in this slot will become your children
Free Shipping Progress Bar Slot Pn