# How to add a custom button in user profile card?

**URL:** <https://meta.discourse.org/t/how-to-add-a-custom-button-in-user-profile-card/300826>\
**Category:** Development\
**Created:** [March 25, 2024, 1:13pm UTC](https://meta.discourse.org/t/how-to-add-a-custom-button-in-user-profile-card/300826 "2024-03-25T13:13:46Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![junbetterway](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/junbetterway/32/372464_2.png) [@junbetterway](https://meta.discourse.org/u/junbetterway)\
**Post date:** [March 25, 2024, 1:13pm UTC](https://meta.discourse.org/t/how-to-add-a-custom-button-in-user-profile-card/300826/1 "2024-03-25T13:13:46Z")

</div>

How can I add a custom button in our user profile summary and card view?  
We wanted to add a CTA that will do something (e.g., redirect) but no data saving…

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/a/9/3a940e8552a0cb15910877760a2d328dab3e602d.png)

and also in the profile card:

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/a/3/1a3afe819e9aac27bf57f791f9d3e6dc973ee513.png)

My initial code below achieves almost but its on the header section & could not find a way to do it on user profile summary & card:

```plaintext
<script type="text/discourse-plugin" version="0.4">
    api.decorateWidget('header-buttons:after', helper => {
        if (Discourse.User.current()) {
            const cta = function() {
                // do something here...
            };
            return helper.h('button#create-new', {
                className: "btn fa fa-plus",
                onclick: cta
            }, 'CTA' );
        }
    });
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-add-a-custom-button-in-user-profile-card/300826)._
