There is no class of fire called electrical. Electricity is an ignition source, and what burns is the insulation, the casing and whatever is next to it, which are class A and sometimes class B fuels. What extinguishers carry instead is an electrical marking: a tested statement that the agent may be used in the presence of live equipment at a stated voltage and from a stated distance.
Which agents carry the electric fire extinguisher marking
Carbon dioxide and dry powder carry it as standard. Some water and foam units carry it after specific dielectric testing, always with a minimum distance printed on the label. A unit without the marking should be treated as unsafe near live equipment whatever the agent is, because the test is what makes the statement, not the chemistry in general.
Isolation first, every time
The first action at any equipment fire is to remove the supply if that can be done safely from a distance, because an energised fault will keep re-igniting whatever is put on it. Every competent procedure puts isolation ahead of extinguisher use, and the statutory duty to work on or near electrical equipment safely sits behind that.
The distance on the label is not advice
Where a water based unit is marked for electrical use, the label states a minimum distance. That figure comes from a dielectric test and is the condition under which the marking holds. Standing closer is outside the test, and the jet becomes a conductive path back to the person holding it.
What to provide in a switch room
Carbon dioxide, because it leaves nothing behind and does not conduct. Provision in those rooms is usually carbon dioxide alone at the equipment with a class A unit for the rest of the space, since the carbon dioxide unit has no class A rating.
An electrical fire extinguisher colour, and the label that matters more
The colour panel identifies the AGENT, not what the extinguisher may be used on, and that is the distinction worth carrying away. Black is carbon dioxide, which is the usual answer for electrical risk. Blue is dry powder, which is also usable on live equipment and is normally kept for outdoor and vehicle risks. Red is water and cream is foam, neither of which is safe on live equipment as a general rule. What decides the question properly is the label, because some water mist and some foam extinguishers are dielectrically tested and marked as suitable for use near live electrical equipment up to a stated voltage and at a stated distance, and an untested unit of the same colour is not. So read the label for the electrical marking and the distance, and treat the colour as a way of finding the right one on the wall rather than as the specification.
Questions people ask about electrical equipment fire extinguisher
Is there such a thing as a live electrical fire extinguisher?
Not as a category. There are extinguishers marked as tested for use near live equipment, which is a narrower and more useful statement than the phrase suggests.
Can foam be used on a plugged in appliance?
Only if that unit carries the electrical marking, and then only at the distance printed on it. A general foam unit should not be taken to live equipment.
What about a lithium battery fire?
That behaves differently again, because the cell supplies its own oxidiser and can re-ignite long after it looks out. The correct response is distance, evacuation and the fire service, not a portable extinguisher.