Pass Props#
Pass props on the component tag:
<PostCard cta_label="Read more" show_badge="true" />Inside the partial, read props by name:
{{ if show_badge }} <span>Featured</span>{{ /if }}<h2><a href="{{ url }}">{{ title }}</a></h2><span>{{ cta_label }}</span>cta_label passes text. show_badge="true" passes a boolean-like flag.
Boolean Shorthand#
For boolean flags, you can write the prop without a value:
<PostCard cta_label="Read more" show_badge />Default Props#
A partial can define defaults before a --- separator:
label: Read moreurl: /---<a href="{{ url }}">{{ label }}</a>Caller props override defaults:
<Button label="View project" url="/projects/" />