Thanks. I had a similar use case a while back, the documentation for the Hydralit Components has fallen way behind how much is available already.
For your case, you can use the first_select parameter, which is an index, 0 is the first item, 10 the second, 20 the third and so on. The reason it’s two digits is if you have a dropdown menu and that is the second item on the menu and you want to select the third item on that dropdown, then the index would be 13, (10 for the dropdown root, 3 for the third item on the dropdown).
For you, you want something like this:
override = st.selectbox('Menu override',[31,10,20,30,31,32,33,40,0,81])
menu_id = hc.nav_bar(menu_definition=menu_data,key='PrimaryNav',first_select=override)
When you change the value of first_select (from override) and rerun, the navbar will return the value of the selected index, for example, if you run the above (and put correct indexes in for your menu definition), when you change the selection in the selectbox, the navbar will automatically select that index and return the value specified in the navbar(either the id or just the label depending on what you gave it), basically a way to puppet the navbar from another widget. Hope that helps. Make sure to update to the latest version 1.0.5.