Skip to content

helpers

Dieter Geerts edited this page Oct 20, 2016 · 4 revisions

HELPERS

How to add your own Handlebars helpers

At the moment, there is no possibility yet to add your own helpers. If you need to, consider using the original Fabricator project, or create a pull request to enable this feature. Fabricator Builder has been made from the original Fabricator in order to use it as a builder with configuration over code. Therefore, some features have been excluded to make it easier to work with. However, there are some built-in helpers you can use.

Built-in helpers

There are some useful helpers already built into Fabricator Builder.

130+ helpers from Handlebars-helpers, prefixed with hh

svgIcon

Will inject one of the icons from the icon folder, for using svg icons inline.

<span>{{svgIcon add}}</span>

iterate

{{#iterate 20}}
  <li>List item {{@index}}</li>
{{/iterate}}

material

{{material name context}}

f-color-chips & f-color-chip

Fabricator Builder defines default color chips to show your toolkit colors. If you don't want to create your own color representation chips, you can use these instead. These use display: flex.

A row of color chips:

{{#each toolkitConfig.colors}}
  {{> f-color-chips this}}
{{/each}}

One color chips:

{{#each this}}
  {{> f-color-chip this}}
{{/each}}