Hello @oltipreka,
As stated by @andfanilo, the only way to achieve what you want is to build your own streamlit component.
You cannot merge a text input and a selectbox natively, but you can at least put them in the same row.
I’ve taken @ash2shukla’s code sample, and modified it accordingly.
I’ve also changed it to automatically select the last input in the selectbox:
import streamlit as st
from state import provide_state
@provide_state
def main(state):
state.inputs = state.inputs or set()
c1, c2 = st.beta_columns([2, 1])
input_string = c1.text_input("Input")
state.inputs.add(input_string)
# Get the last index of state.inputs if it's not empty
last_index = len(state.inputs) - 1 if state.inputs else None
# Automatically select the last input with last_index
c2.selectbox("Input presets", options=list(state.inputs), index=last_index)
if __name__ == "__main__":
main()
PS: @ash2shukla I like your provide_state decorator, I may use it for an another alternative state implementation 