Law of conservation of energy and circuits

How does the law of conservation of energy work in circuits?

If we have a voltage source to which a resistor, capacitor and and an inductor are connected, then will the kinetic energy of the electrons will be consumed in resistor, be stored in an inductor in the form of magnetic field, and be stored in a capacitor in the form of magnetic field?

And if we add the three energies of the resistor, inductor, and capacitor then will the total energy be equal to the energy supplied by the voltage source?

Is this the way law of conservation of energy works in circuits?

Indeed, this is how it works: the energy supplied by the power source is stored as the energy of capacitors and inductances, $$U_C = \frac{Q^2}{2C}, U_L = \frac{LI^2}{2},$$ and dissipated as Joule's heat by the resistances with power $$P_J = \frac{I^2}{R}.$$ The capacitive and the inductive energies can be though of as the potential and the kinetic energies: the former is the energy due to the static charge (i.e. static electrons), whereas the latter is due to the current (i.e. the electrons in motion). The energy dissipated in the resistor corresponds to friction, i.e. the loss of the energy. This is why the Joule's heat is represented as power - i.e. the energy lost per unit time.