Toast
Basic With Header
{% component "Toast" %}
{% component "ToastHeader" %}
<img src="https://placehold.net/600x400.png" class="rounded me-2" alt="Toast icon">
<strong class="me-auto">Bootstrap</strong>
<small>11 mins ago</small>
{% endcomponent %}
{% component "ToastBody" %}
Hello, world! This is a toast message.
{% endcomponent %}
{% endcomponent %}
Preview:
Bootstrap
11 mins ago
Hello, world! This is a toast message.
Autohide False
{% component "Toast" autohide=False %}
{% component "ToastHeader" %}
<img src="https://placehold.net/600x400.png" class="rounded me-2" alt="Toast icon">
<strong class="me-auto">Bootstrap</strong>
<small>11 mins ago</small>
{% endcomponent %}
{% component "ToastBody" %}
Hello, world! This is a toast message.
{% endcomponent %}
{% endcomponent %}
Preview:
Bootstrap
11 mins ago
Hello, world! This is a toast message.
Translucent
{% component "Toast" %}
{% component "ToastHeader" %}
<img src="https://placehold.net/600x400.png" class="rounded me-2" alt="Toast icon">
<strong class="me-auto">Bootstrap</strong>
<small class="text-body-secondary">11 mins ago</small>
{% endcomponent %}
{% component "ToastBody" %}
Hello, world! This is a toast message.
{% endcomponent %}
{% endcomponent %}
Preview:
Bootstrap
11 mins ago
Hello, world! This is a toast message.
Stacking
<div class="toast-container position-static">
{% component "Toast" %}
{% component "ToastHeader" %}
<img src="https://placehold.net/600x400.png" class="rounded me-2" alt="Toast icon">
<strong class="me-auto">Bootstrap</strong>
<small class="text-body-secondary">just now</small>
{% endcomponent %}
{% component "ToastBody" %}
See? Just like this.
{% endcomponent %}
{% endcomponent %}
{% component "Toast" %}
{% component "ToastHeader" %}
<img src="https://placehold.net/600x400.png" class="rounded me-2" alt="Toast icon">
<strong class="me-auto">Bootstrap</strong>
<small class="text-body-secondary">2 seconds ago</small>
{% endcomponent %}
{% component "ToastBody" %}
Heads up, toasts will stack automatically
{% endcomponent %}
{% endcomponent %}
</div>
Preview:
Bootstrap
just now
See? Just like this.
Bootstrap
2 seconds ago
Heads up, toasts will stack automatically
Custom Content Simplified
{% component "Toast" attrs:class="align-items-center" %}
<div class="d-flex">
{% component "ToastBody" %}
Hello, world! This is a toast message.
{% endcomponent %}
{% component "CloseButton" attrs:class="me-2 m-auto" attrs:data-bs-dismiss="toast" / %}
</div>
{% endcomponent %}
Preview:
Hello, world! This is a toast message.
Custom Content With Actions
{% component "Toast" %}
{% component "ToastBody" %}
Hello, world! This is a toast message.
<div class="mt-2 pt-2 border-top">
{% component "Button" variant="primary" size="sm" %}Take action{% endcomponent %}
{% component "Button" variant="secondary" size="sm" attrs:data-bs-dismiss="toast" %}Close{% endcomponent %}
</div>
{% endcomponent %}
{% endcomponent %}
Preview:
Hello, world! This is a toast message.
Color Scheme Primary
{% component "Toast" attrs:class="align-items-center text-bg-primary border-0" %}
<div class="d-flex">
{% component "ToastBody" %}
Hello, world! This is a toast message.
{% endcomponent %}
{% component "CloseButton" variant="white" attrs:class="me-2 m-auto" attrs:data-bs-dismiss="toast" / %}
</div>
{% endcomponent %}
Preview:
Hello, world! This is a toast message.
Toast Container Bottom End
{% component "ToastContainer" position="end" attrs:class="bottom-0 p-3" %}
{% component "Toast" %}
{% component "ToastHeader" %}
<img src="https://placehold.net/600x400.png" class="rounded me-2" alt="Toast icon">
<strong class="me-auto">Bootstrap</strong>
<small>11 mins ago</small>
{% endcomponent %}
{% component "ToastBody" %}
Hello, world! This is a toast message.
{% endcomponent %}
{% endcomponent %}
{% endcomponent %}
Preview:
Bootstrap
11 mins ago
Hello, world! This is a toast message.