Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

How to add Tooltip attribute to a custom PCF Control?

(0) ShareShare
ReportReport
Posted on by 61

Hello

I have been trying to add a tooltip to a custom pcf control but i cannot get it to work. Is there any developer, that know how i can achieve a simple tooltip in a custom pcf control?

Currently im using this syntax: (Does not work!)

 

this._container.addEventListener("mouseover", function () {
 _this._isHovered = true;
 _this._notifyOutputChanged();
 this.style.cursor = 'pointer';

 const tooltip = document.createElement('div');
 tooltip.textContent = 'Test tooptip';

 tooltip.style.position = 'absolute';
 tooltip.style.background = 'rgba(0, 255, 0, 0.7)';
 tooltip.style.color = '#fff';
 tooltip.style.padding = '5px';
 tooltip.style.borderRadius = '5px';
 tooltip.style.left = (element.offsetLeft + 10) + 'px';
 tooltip.style.top = (element.offsetTop + 10) + 'px';

 document.body.appendChild(tooltip);
});

 

 

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: How to add Tooltip attribute to a custom PCF Control?

    @JohnMarkPerez did this post help resolve your issue? If so, please mark the solution for future forum visitors to see!

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: How to add Tooltip attribute to a custom PCF Control?

    Don't add the event listener to Container. Create a new child element with document.createElement("div") and attach that child to Container, not document.body. 

     

    Something like:

    let myDiv = document.createElement('div');
    
    //set various attributes to dev, including cursor style and mouseover listener
    
    this._container.appendChild(myDiv);

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 55 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 44 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 31 Super User 2025 Season 1

Overall leaderboard