Slotted card
Description
A card with named slots for header, body, and footer areas.
Demonstrates the named slots feature — a BlockComponent with
Meta.slots declaring multiple content areas that template authors
fill using {% slot "name" %}...{% endslot %}.
The body slot is required; header and footer are optional
and will be omitted from the output when not provided.
Example usage:
{% slotted_card title="Welcome" %}
{% slot "header" %}
<img src="banner.jpg" alt="Banner">
{% endslot %}
{% slot "body" %}
<p>Main card content goes here.</p>
{% endslot %}
{% slot "footer" %}
<button>Save</button>
{% endslot %}
{% endslotted_card %}
Minimal usage (only required slot):
{% slotted_card %}
{% slot "body" %}
<p>Just the body.</p>
{% endslot %}
{% endslotted_card %}
Usage
Simple Card
{% slotted_card "Welcome Card" %}
{% slot "body" %}This is a basic card body with clean layout.{% endslot %}
{% endslotted_card %}
All parameters
{% slotted_card "foo" variant="default" %}
{% slot "body" %}Sample body content{% endslot %}
{% slot "header" %}Sample header content{% endslot %}
{% slot "footer" %}Sample footer content{% endslot %}
{% endslotted_card %}
Qualified tag usage
{% cards__slotted_card "Welcome Card" %}
{% slot "body" %}This is a basic card body with clean layout.{% endslot %}
{% endcards__slotted_card %}
Parameters
| Name | Type | Requirement | Default | Choices | Description |
|---|---|---|---|---|---|
title
|
str
|
Optional | — | — | Optional card title displayed above the body. |
variant
|
str
|
Required |
default
|
default
elevated
outlined
|
Visual variant of the card. |
Slots
| Name | Requirement | Default | Description |
|---|---|---|---|
body
|
Required | — | Main card content. |
header
|
Optional | — | Optional header area above the title. |
footer
|
Optional | — | Optional footer area below the body. |
Select variant preset
Background colour
Viewport width
Zoom level
{% slotted_card "Welcome Card" %}
{% slot "body" %}This is a basic card body with clean layout.{% endslot %}
{% endslotted_card %}
<div class='slotted-card default'><div class='slotted-card__header'>Sample header content</div><h3 class='slotted-card__title'>foo</h3><div class='slotted-card__body'>Sample body content</div><div class='slotted-card__footer'>Sample footer content</div></div>