In some examples, a device includes a nanovoided polymer element, a planarization layer disposed on a surface of the nanovoided polymer element, a first electrode disposed on the planarization layer, and a second electrode. The nanovoided polymer element may be located at least in part between the first electrode and the second electrode. The planarization layer may be located between the nanovoided polymer element and the first electrode.