Button linline with text

is there a way in streamlit to create a button that is inline with text. which clicked on can call a function?

image

Please help

Hi @Swaroop_Mg

You could count the number of clicks and store that data to the session state.

Here’s a simple example code snippet:

import streamlit as st

st.title('Counter Example')
count = 0

increment = st.button('Increment')
if increment:
    count += 1

st.write('Count = ', count)

More info in the Docs:

Hope this helps!

Thank you so much for the reply.
Im actually not looking for a counter, im looking for a button that looks like the screenshot i shared.
Im not sure if this is supported on streamlit or if it’s a JS / HTML functionality - it should allow me to place the button in between text/ inline with text.

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