Simple Example Of Creating A View Using HTMLElement


There are a few examples in of HTMLElement based views, but most are encumbered by having to support the legacy of the prior SpacePen views.

Does anyone have an example of a minimal HTMLElement based view - perhaps one which displays a list of items? I would like to replace the autocomplete SelectListView / autocomplete-plus SimpleSelectListView with an HTMLElement based View, and am beginning my learning of HTMLElement.

/cc @abe @nathansobo


I recently updated my status bar indicator packages to use the HTMLElement style. One example is my IndentationIndicatorView:

The pattern was copied shamelessly from @maxbrunsfeld’s work on the GrammarStatusView:


Another example of an even simpler view is in the new Package Generator. If you generate a new package, the demo view in there has been updated for the new system.


I think it should be pretty straightforward, once you have your element class (like in @leedohm examples) you can handle the item rendering in whatever way you prefer, whether through innerHTML (bad) or through appendChild.

Is there anything in a list management that confuse you?