SAP Builders Blog Posts
Learn from peers about their low-code journey and write your own blog posts to share your thoughts and experiences as you become an SAP Builder.
Showing results for 
Search instead for 
Did you mean: 
Developer Advocate
Developer Advocate

See all 3 parts of the custom component series:

Both the tooltip and Fiori dialog are available for use now.

We started by taking a blank project and adding the following components:

  • Container (this we need because all custom components need to be housed in a container)
  • Icon (users will click this to show the tooltip)
  • Container (this will be the background of our tooltip)
  • Text (this will be the tooltip)

Select the icon component and change the icon to display the information Fiori icon.


For the inner container, set the spacing:

  • Width should be set under Custom, with Fit content and minimum 150 pixels, maximum 250 pixels. The height and width should be Fit Content
  • Position should be absolute, with an indent of 24 pixels, and a Z-index of 10 (click Set to Number and then type in 10) so it displays on top of any other components.
  • Under Style, set the padding to 4 pixels on all sides. You can also set a shadow if you want.
  • And we want to show the container only when the user clicks the button, so under Properties → Advanced Properties → Visible, we bind the visibility to the ShowInfo private variable.

dan_wroblewski_8-1702199528336.png   dan_wroblewski_9-1702199568741.png


For the Text component, we need to also set the width to Custom, and select Fit Content and minimum of 150 pixels and maximum to 250 pixels. The height should be Grow to height.


And we need to bind the Text component's Content property to our custom component's Text property, so developers can set the text.


The property appears under Composite component internal property.


You can also set the color of the icon, text container, and text.

Assign Logic

Now we want the tooltip to appear when the user clicks the icon, and disappear on another click. We will also make the text disappear automatically after 5 seconds.

In the Component Template Editor for the custom component, add a set private variable flow function, and set our ShowInfo private variable to a formula to toggle its state:






You can now save the project and test the component. If you click the icon, you should see the tooltip with default text.

Let's add the feature to automatically hide the tooltip after 5 seconds. We add the following:

  • If condition, to test if the tooltip is still visible.
  • Delay, to delay 5 seconds if the tooltip is visible.
  • Set private variable, to turn our private variable to false.


Publishing the Component

The component you created is under the By Me tab (where the components are shown), which shows the custom components you have modified. This new component will only be in your project. If you want to share or reuse, click the 3 dots and select Publish to marketplace.


Then select Publish New. This makes it available to any user in your BTP landscape (e.g., eu10).


You will get an alert with the token for finding your component in the marketplace. Save this token.


The component is now removed from the By Me tab and moved to the Installed tab.


The component can be found in your subaccount by searching for the title or description. Any other user in the BTP landscape will need the token.

Using the Component

Let's say we had a UI with 2 buttons and we wanted to put the tooltip in the middle.


We can click on Marketplace.


Enter the token, and the component is displayed.


Click on the component, and click Install. It will be in the Installed tab.

Now drag a copy of the component between the buttons. 


With the tooltip selected, in the Properties tab, add some text. I added this using a formula (if you add as plain text, the slashes will be escaped). You can use the Unicode characters to add spacing or special characters.



"This is the first line of the tooltip. \u000A\u000A This is the second line of the tooltip."



If you preview the app, you will see that it creates a lot of extra space, and the tooltip is masked by the container in the app.


So you must do the following:

  • For the container holding the buttons and the tooltip, set LayoutLayout → Clip overflowing content to No.
  • For the tooltip component, set Layout → Width and Height to Fit content.
  • For the tooltip component, set Layout → Position → Z-index to 10.

And now run the app again, and click the icon.




Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi, @Dan_Wroblewski 

I couldn't have seen this feature for a while, Is this no longer available?


Developer Advocate
Developer Advocate
0 Kudos

You mean my component or the ability to create your own component?


I assume the question refers to the 'share' feature, which has been changed lately. 

I have noticed as well, that the components no longer generate a 'share token', however, a user can click now on the 'Copy to clipboard' which is essentially a share token that can be pasted into the marketplace and then the target component would be available for installation. 


NOTE: this seems to be working, however as soon as the copied component that the user wants to install has more complex internal logic (using flow functions from the marketplace) or uses other non-default components (e.g. iframe) then it will throw the following error on component install: 


So whenever you install a new component with the 'Copy to clipboard' method, make sure to have every used flow / component installed prior to adding the new component to the canvas. 

I am confident that this will be solved in a future release of the Composer, but it is important to know about this limitation before creating complex custom components with internal logic. I always strongly advise using the pure and default flow functions, but that cannot always be the case. 

Developer Advocate
Developer Advocate

Thanks @mihaly-toth-nc 

Yes, the whole sharing of components has changed. You can also read about it here in the documentation:

Essentially to create a component:

  • Create container and add all your component parts
  • Convert container to component
  • In By Me tab, click Copy to Clipboard for your component
  • Send the text to someone

Essentially to reuse a component:

  • Go to marketplace
  • Paste component text into the search field
  • Click Add to App -- now it appears in By Me tab and you can drag it in

This is the text of my component:


However, the layout and color did not keep when I pasted it in ... I need to figure out why. 

0 Kudos

Well, the color and the layout could potentially be due to the difference in 'theme' settings as well as something else.
What is really important to watch out for is to only use flows and UI components that are 'default' in any application, else you will receive the 'missing component' and cannot be imported error as mentioned above.
That is particularly painful when you create a custom component that relies on 'set output value' flow functions.
One workaround for this is to use the custom JS whenever possible, or previously import all required dependency into the target app as well.