How to design components?

What are some guidelines/principles when it comes to designing components(irrespective of front-end framework)?