For the speed control of my Maxun One solar bike, I use an up-down thumb-throttle switch. Normally, such a throttle is mounted between grip and the brake lever which increases the distance between them. That's why I made a throttle that is mounted on top of the brake lever clamp so that no extra space is needed on the handlebar. See the full article here: https://www.avdweb.nl/solar-bike/mechanical-issues/diy-ergonomic-space-saving-e-bike-thumb-throttle-switch