## Widgets Widgets are the building blocks of our UI. We are currently making all our widgets [WebComponents](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) based on [Lit](https://lit.dev/docs/). Many of our widgets use [Shoelace](https://shoelace.style) components as building blocks. If you just want to use existing widgets, you can put them in your .xet template file: ```xml ``` Rendered example template ## Attributes Widget behaviour is customised by setting attributes ### ID // TODO, maybe some notes about content & namespaces. ### Disabled vs Readonly vs Hidden Disabled widgets are fully shown, but in a way that indicates the value cannot be changed. Use disabled to indicate that at some point a user may be able to change the value, but not right now. The widget may be enabled via javascript. Readonly widgets are shown in a special way that displays a value, but is not interactive. Often we switch to a different component for faster performance, such as a simple label. It is impossible to change the value of a readonly widget, and it cannot be made editable via javascript - the page must be reloaded. Hidden widgets are not visible, but may be enabled via javascript. ```html:preview
Normal
Disabled
Readonly
Hidden
``` When the page is submitted normal and hidden widgets will have their values returned and validated. Widgets that are disabled when the page is submitted will not return their value. Readonly widgets do not return a value.