uikit-alert.html.twig in UIkit Components 8.3
Default theme implementation for a UIkit Alert.
Available variables:
- message: The message to display in the alert.
- style: The style of the alert. Possible values:
- primary: Give the message a prominent styling.
- success: Indicates success or a positive message.
- warning: Indicates a message containing a warning.
- danger: Indicates an important or error message.
Defaults to "primary".
- close_button: Boolean indicating whether to include a close button in the alert. Defaults to FALSE.
File
templates/components/uikit-alert.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation for a UIkit Alert.
- *
- * Available variables:
- * - message: The message to display in the alert.
- * - style: The style of the alert. Possible values:
- * - primary: Give the message a prominent styling.
- * - success: Indicates success or a positive message.
- * - warning: Indicates a message containing a warning.
- * - danger: Indicates an important or error message.
- * Defaults to "primary".
- * - close_button: Boolean indicating whether to include a close button in the
- * alert. Defaults to FALSE.
- *
- * @see \Drupal\uikit_components\Element\UIkitAlert
- * @see template_preprocess_uikit_alert()
- * @see https://getuikit.com/docs/alert
- *
- * @ingroup uikit_components_theme_render
- */
- #}
- {% if message %}
- <div{{ attributes.addClass('uk-alert-' ~ style|clean_class) }}>
- {% if close_button %}
- <a class="uk-alert-close" data-uk-close></a>
- {% endif %}
-
- <p>{{ message }}</p>
- </div>
- {% endif %}