Shift register, yes. 74HC595, 70mA total current output, one should limit LEDs to 8-9mA to avoid overstressing VCC or Gnd pin.
TPIC6C595 or TPIC6B595 are much better shift register for sinking current thru LEDs, can get full 20mA no problem, can drive one (8 outputs) or many daisy chained devices (I’ve done 45) with just 3 pins.
one of IO0 to IO15 connects bidirectionally to the common IO pin. If the common IO pin been pinMode’d to output, then you can drive an LED connected to one of IO0 to IO15. If it has been pinMode’d to input, then you can read a switch that is pulled HIGH or LOW (at the switch) that is connected to a different one of IO0 to O15. Keep the series resistance of the part in mind or you may get unexpected results.
pinMode can be used on the fly in loop(). If you cycle thru reading/writing quickly and are driving LEDs, turned-on LEDs may seem dimmer vs just driving them with a shift register.
If you wire up a switch & LED like this, you can read the switch and let it control the LED.