Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/docs/03-syntax-and-usage/09-template-composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ templ right() {
</div>
```

Templates need to be called on their own line.
```templ
templ showLeftWithLabel() {
<div>
Left:
@left()
</div>
}

templ left() {
<div>Left</div>
}
```
:::note
If you have a string preceding the template call inline, such as `Left: @left()`, it would output `Left: @left()` exactly.<br/>
The templ component would not be generated.
:::

# Children

Children can be passed to a component for it to wrap.
Expand Down