A Widget should be:
- Declarative Only
- Don't hard-code values within widgets, use properties instead and bind to properties as much as you can.
- Test your widgets with different apps, widgets should work independently from the data model.
- Test your widget in the Widget editor for different object sizes.
- Use the resize gripper in the "Preview" pane for testing different object sizes.
One of the core concepts of widgets is that only Html and CSS/Less should be used.
In this tutorial