This paper deals with the design of switching rules for switched linear systems with inputs, in such a way that the resulting closed-loop system is exponentially convergent. Two types of switching rules are addressed, that is state-based and observer-based rules. The developed theory is illustrated by two examples.