The authors report a novel optical bistable device, the resonant-tunnelling triangular-barrier optoelectronic switch (R-TOPS), which consists of a double-barrier resonant-tunnelling diode and a triangular-barrier phototransistor. Clear negative differential resistance and bistability with high contrast and high sensitivity are demonstrated.