mirror of
https://github.com/hunvreus/basecoat.git
synced 2026-11-12 05:08:18 +00:00
5.2 KiB
5.2 KiB
templateEngineOverride, layout, title, description, toc
| templateEngineOverride | layout | title | description | toc | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| njk | layouts/page.njk | Alert | Displays a callout for user attention. |
|
{% from "macros/code_preview.njk" import code_preview %} {% from "macros/code_block.njk" import code_block %}
{% set code %}
{% lucide "circle-check" %}
This is an alert with icon, title and description.
Success! Your changes have been saved
{% lucide "popcorn" %}
This is an alert with icon, title and description.
This Alert has a title and an icon. No description.
{% lucide "circle-check" %}
Unable to process your payment.
Please verify your billing information and try again.
- Check your card details
- Ensure sufficient funds
- Verify billing address
Usage
Use the alert or alert-destructive.
{% set code_simple %}
{% lucide "circle-check" %}
This is an alert with icon, title and description.
{% endset %}
{{ code_block(code_simple | prettyHtml) }}
Success! Your changes have been saved
The component has the following HTML structure:
<div class="alert">- Main container. Use
alertfor default styling oralert-destructivefor error states.<svg>Optional- The icon.
<h2>- The title.
<section>Optional- The description.
<div data-action>Optional- An action aligned to the inline end of the alert.
Examples
Destructive
{% set code %}
{% lucide "circle-alert" %}
Your session has expired. Please log in again.
{% endset %}
{{ code_preview("alert-destructive", code) }}
Something went wrong!
No description
{% set code %}
{% lucide "shield-alert" %}
{% endset %}
{{ code_preview("alert-no-description", code) }}
This is a very long alert title that demonstrates how the component handles extended text content and potentially wraps across multiple lines
No icon
{% set code %}
Success! Your changes have been saved
Action
{% set code %}
{% lucide "info" %}
Receive updates when there is activity in your workspace.
{% endset %}
{{ code_preview("alert-action", code) }}
Enable notifications
Enable
Custom Colors
{% set code %}
{% lucide "triangle-alert" %}
Upgrade your plan or delete unused files.
{% endset %}
{{ code_preview("alert-custom-colors", code) }}
Storage almost full
RTL
Alerts support right-to-left layouts through logical spacing and native text flow. Add dir="rtl" to the alert or an ancestor.
{% set code %}
{% lucide "info" %}
تم تحديث إعداداتك بنجاح.
{% endset %}
{{ code_preview("alert-rtl", code) }}
تم حفظ التغييرات
عرض