Skip to content

Add an on_click parameter to st.link_button  #7453

@dwvisser

Description

@dwvisser

Checklist

  • I have searched the existing issues for similar feature requests.
  • I added a descriptive title and summary to this issue.

Summary

We have a use case where we would like to take action on the server when the user clicks a hyperlink, which in this case would be rendered as a st.link_button. Would it be possible to add an on_click parameter similar to that in st.button and st.download_button?

Why?

In our case, we want to mark a result as having been read by the user whenever they access it via hyperlink. Our Streamlit application highlights already read results.

How?

Add an on_click parameter to st.link_button that is given a function to call when the widget is clicked, similar to what st.button and st.download_button already have.

Additional Context

No response

Metadata

Metadata

Assignees

Labels

feature:st.link_buttonRelated to the `st.link_button` widgettype:enhancementRequests for feature enhancements or new features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions