Skip to main content

Template

Use a template card to display content authored using Handlebars templates.

Check the full API at ui.template_card().

template-0

from h2o_wave import pack
menu = '''
<ol>
{{#each dishes}}
<li><strong>{{name}}</strong> costs {{price}}</li>
{{/each}}
</ol
'''

q.page['template_example'] = ui.template_card(
box='1 1 2 2',
title='Menu',
content=menu,
data=pack(dict(dishes=[
dict(name='Spam', price='$2.00'),
dict(name='Ham', price='$3.45'),
dict(name='Eggs', price='$1.75'),
])),
)