# Component link\_button returns nothing?

**URL:** <https://discuss.streamlit.io/t/component-link-button-returns-nothing/66628>\
**Category:** Using Streamlit\
**Tags:** debugging\
**Created:** [April 9, 2024, 7:24pm UTC](https://discuss.streamlit.io/t/component-link-button-returns-nothing/66628 "2024-04-09T19:24:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ognend](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/ognend/32/47674_2.png) [@ognend](https://discuss.streamlit.io/u/ognend)\
**Post date:** [April 9, 2024, 7:24pm UTC](https://discuss.streamlit.io/t/component-link-button-returns-nothing/66628/1 "2024-04-09T19:24:46Z")

</div>

Hello! Does st.link\_button component return anything? For example, I can say

```auto
if st.button(params....):
  do something

```

Can I do the same for st.link\_button?

If not, what is a good way to display some linkable text that acts exactly like link\_button but either has an on\_click callback possibility or otherwise lets me know that it has been clicked? I do not want st.button() 😉

Thanks!

---

<div class="post-metadata">

**Author:** ![Guna\_Sekhar\_Venkata](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/guna_sekhar_venkata/32/44735_2.png) [@Guna\_Sekhar\_Venkata](https://discuss.streamlit.io/u/Guna_Sekhar_Venkata)\
**Post date:** [April 10, 2024, 7:25am UTC](https://discuss.streamlit.io/t/component-link-button-returns-nothing/66628/2 "2024-04-10T07:25:21Z")

</div>

Hey @ognend . Welcome to the community!. I have a doubt that you want return any thing by using that function or anything else?? According to the [documentation](https://docs.streamlit.io/develop/api-reference/widgets/st.link_button) it doesn’t return anyting.

---

<div class="post-metadata">

**Author:** ![Goyo](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/goyo/32/28219_2.png) [@Goyo](https://discuss.streamlit.io/u/Goyo)\
**Post date:** [April 10, 2024, 7:51am UTC](https://discuss.streamlit.io/t/component-link-button-returns-nothing/66628/3 "2024-04-10T07:51:33Z")

</div>

> [@ognend](#):
>
> I do not want st.button()

Why not? It seems to be exactly what you need.

---

<div class="post-metadata">

**Author:** ![lkdd-ao](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/lkdd-ao/32/47689_2.png) [@lkdd-ao](https://discuss.streamlit.io/u/lkdd-ao)\
**Post date:** [April 10, 2024, 8:07am UTC](https://discuss.streamlit.io/t/component-link-button-returns-nothing/66628/4 "2024-04-10T08:07:44Z")

</div>

I understand his meaning, he wants to achieve the following 👇 Has anyone triggered the link as a result.  
 ![1712736453773](https://global.discourse-cdn.com/streamlit/original/3X/e/0/e0b3db1e0634d07209e4f8ba7dc5f7fa379e7422.png)

---

<div class="post-metadata">

**Author:** ![ognend](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/ognend/32/47674_2.png) [@ognend](https://discuss.streamlit.io/u/ognend)\
**Post date:** [April 10, 2024, 12:12pm UTC](https://discuss.streamlit.io/t/component-link-button-returns-nothing/66628/5 "2024-04-10T12:12:09Z")

</div>

> [@Goyo](#):
>
> Why not? It seems to be exactly what you need.

Because I have an app where if I use the button which is inside a container (column) and someone clicks on the button, I open the link in a different tab. When this happens the output inside the column where the button is becomes mangled. I need to know if someone has clicked the link to open the url. So, the button will not work (don’t know if it is a bug or…) and the link\_button fits the bill, only it doesn’t seem to return a value nor does it allow for an on\_click callback (which makes me wonder what the purpose of it is).

---

<div class="post-metadata">

**Author:** ![ognend](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/ognend/32/47674_2.png) [@ognend](https://discuss.streamlit.io/u/ognend)\
**Post date:** [April 10, 2024, 12:13pm UTC](https://discuss.streamlit.io/t/component-link-button-returns-nothing/66628/6 "2024-04-10T12:13:34Z")

</div>

> [@Guna\_Sekhar\_Venkata](#):
>
> Hey @ognend . Welcome to the community!. I have a doubt that you want return any thing by using that function or anything else?? According to the [documentation](https://docs.streamlit.io/develop/api-reference/widgets/st.link_button) it doesn’t return anyting.

I want to know if someone clicked the button (followed the link).

---

<div class="post-metadata">

**Author:** ![Guna\_Sekhar\_Venkata](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/guna_sekhar_venkata/32/44735_2.png) [@Guna\_Sekhar\_Venkata](https://discuss.streamlit.io/u/Guna_Sekhar_Venkata)\
**Post date:** [April 10, 2024, 12:44pm UTC](https://discuss.streamlit.io/t/component-link-button-returns-nothing/66628/7 "2024-04-10T12:44:53Z")

</div>

@ognend Then i think you need to write script related to how many people visited that website!! right!!!

---

<div class="post-metadata">

**Author:** ![Goyo](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/goyo/32/28219_2.png) [@Goyo](https://discuss.streamlit.io/u/Goyo)\
**Post date:** [April 10, 2024, 12:45pm UTC](https://discuss.streamlit.io/t/component-link-button-returns-nothing/66628/8 "2024-04-10T12:45:57Z")

</div>

Well, if just a button click and opening a new browser tab mangles your app then I think yes, there is a bug somewhere.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/streamlit/original/3X/c/f/cf4c2ee0d938358f82448c5fe4b9c3c91d7ce19c.svg) [@system](https://discuss.streamlit.io/u/system)\
**Post date:** [October 7, 2024, 12:46pm UTC](https://discuss.streamlit.io/t/component-link-button-returns-nothing/66628/9 "2024-10-07T12:46:19Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
