Skip to content

Writing a new widget

Ivan Kuchin edited this page Apr 11, 2021 · 2 revisions

Smashing contains several widgets ready to use when you create a new dashboard. Or you can use one of the many community contributed widgets.

Finally, you are also able to create a completely new widget from scratch. The easiest way to get started writing a new widget, is by looking at one of the widgets bundled with Smashing, or one of the community contributed widgets. Just find one that looks similar to the one you need, and adapt it to your needs.

Sharing your widget

If the widget is in a gist file, you can use the Smashing command smashing install GIST_ID, and it will copy all the files in place. Be sure to check out the gist's README to see if you need to do any extra configuration.

The easiest way to share a widget is to create a gist with the required files. Be sure to include a README with some instructions on how to use it. Bonus points for including pictures or a link to a live demo.

If you think your widget could be used by other users, feel free to share it with the community.

Known issues

  • Your dashboard will not be working properly if your widget has an empty HTML file. A workaround is including any content to your widget HTML, for example <!----> (empty HTML comment), &nbsp; (HTML non blank white space), etc… This is a limitation from batman.js which is unfortunately not supported anymore.
Clone this wiki locally