In Brilliant Directories, our widgets ares similar to how a widget, extension or plug-in works in Wordpress, Joomla, Magento, Drupal, Odoo and more. They extend the basic functionality of your site. There are several types of widgets based on their functionality, place of use and relation to other widgets.
Some widgets are used to send information to other widgets.
Some widgets are used to simply style a portion of a page, the whole content of the page or the elements from other widgets
But most widgets are used to add functionality to a page, a content or even your whole site.
So how does a widget work?
When a widget is used on a page, it is first processed in the backend for its PHP code. While it is doing this, no CSS, HTML or JS code is created on the page until the widget process is finished. When the backend has finished processing the widget, including communicating with another widget or part of the backend, the resulting HTML, CSS and JS for it is send to the frontend and will be applied to the page in general. This means that, not only is the HTML, CSS and JS of a widget applied to the part of the page where the widget is used, but that a widget can in fact interact and modify the HTML, CSS and JS of another widget on the page.
With this in mind, you could create different widgets that add functionality to a page, add styling to the same page or communicate with the backend or with another widget.