Interest in photonic crystal nanocavities is fueled by advances in device performance, particularly in the development of low-threshold laser sources. Effective electrical control of high-performance photonic crystal lasers has thus far remained elusive due to the complexities associated with current injection into cavities. A fabrication procedure for electrically pumping photonic crystal membrane devices using a lateral p-i-n junction has been developed and is described in this study. We have demonstrated electrically pumped lasing in our junctions with a threshold of 181 nA at 50 K-the lowest threshold ever demonstrated in an electrically pumped laser. At room temperature, we find that our devices behave as single-mode light-emitting diodes (LEDs), which when directly modulated, have an ultrafast electrical response up to 10 GHz corresponding to less than 1 fJ/bit energy operation-the lowest for any optical transmitter. In addition, we have demonstrated electrical pumping of photonic crystal nanobeam LEDs, and have built fiber taper coupled electro-optic modulators. Fiber-coupled photodetectors based on two-photon absorption are also demonstrated as well as multiply integrated components that can be independently electrically controlled. The presented electrical injection platform is a major step forward in providing practical low power and integrable devices for on-chip photonics.