How to add a size bar to a scatter plot

Is it possible to add a size bar showing me the values of the biggest and smallest markers on a scatter plot that has a marker size dimension? I have seen something like this in Plotly.py and would like to recreate it in Plotly.js (React).

I have my marker sizes working correctly, I just need a size bar (similar to the colour bar) to give indication of the sizes corresponding values.

I have looked through the docs and can’t find anything (maybe I’m not looking properly!), and I have seen it done with Plotly.py before so I hope it’s possible in javascript.

Thanks