<section class="rtds-cta-banner rtds-shadow-md rtds-background-03 rtds-cta-banner--bg-icon-right" style="background-image: url(../../images/banner-bg-icon.svg);">
<div class="rtds-cta-banner__grid rtds-grid rtds-grid-cols-1 lg:rtds-grid-cols-12 lg:rtds-gap-6">
<div class="rtds-cta-banner__content rtds-p-2 lg:rtds-p-5 lg:rtds-col-span-6 rtds-flex rtds-flex-col">
<div class="rtds-space-y-2">
<h2 class="rtds-heading-1">
Banner a due colonne
</h2>
<div class="rtds-text-sm lg:rtds-text-base">
<p>
Questa è la descrizione del banner che apparirà nella colonna di sinistra insieme al titolo, mentre i pulsanti CTA saranno posizionati nella colonna di destra.
</p>
</div>
</div>
</div>
<div class="rtds-cta-banner__cta-col rtds-p-2 lg:rtds-p-5 lg:rtds-col-span-6 rtds-flex rtds-flex-col rtds-justify-end rtds-gap-4 lg:rtds-items-end">
<div class="rtds-cta-banner__cta rtds-grid sm:rtds-flex sm:rtds-flex-wrap rtds-gap-2">
<a href="#" class="rtds-btn
rtds-btn--icon-right rtds-group/button rtds-btn--primary">
Azione principale
<svg class="rtds-icon rtds-fill-current rtds-w-4 rtds-h-4 md:rtds-w-5 md:rtds-h-5 lg:rtds-w-6 lg:rtds-h-6 group-hover/button:rtds-translate-x-1" aria-hidden="true" focusable="false" role="img">
<use href="../../icons.svg#mini--arrow-right" />
</svg>
</a>
</div>
</div>
</div>
</section>
<section class="rtds-cta-banner{% if hasShadow %} rtds-shadow-md{% endif %}{% if classes %} {{ classes }}{% endif %}{% if imgBg %} rtds-cta-banner--img-bg{% endif %}{% if hasMaxWidth %} rtds-cta-banner--max-width{% endif %}"{% if not iconPath and imgPath %} style="background-image: url({{ imgPath | path }});"{% endif %}>
<div class="rtds-cta-banner__grid rtds-grid rtds-grid-cols-1 lg:rtds-grid-cols-12 lg:rtds-gap-6">
<div class="rtds-cta-banner__content rtds-p-2 lg:rtds-p-5 lg:rtds-col-span-6 rtds-flex rtds-flex-col">
<div class="rtds-space-y-2">
<h2 class="rtds-heading-1">
{{ title }}
</h2>
{% if description and layout != '2-col-stacked' %}
<div class="rtds-text-sm lg:rtds-text-base">
<p>
{{ description }}
</p>
</div>
{% endif %}
</div>
</div>
<div class="rtds-cta-banner__cta-col rtds-p-2 lg:rtds-p-5 lg:rtds-col-span-6 rtds-flex rtds-flex-col rtds-justify-end rtds-gap-4 {% if layout != '2-col-stacked' %} lg:rtds-items-end{% endif %}">
{% if description and layout == '2-col-stacked' %}
<div class="rtds-text-sm lg:rtds-text-base">
<p>
{{ description }}
</p>
</div>
{% endif %}
{% if cta %}
<div class="rtds-cta-banner__cta rtds-grid sm:rtds-flex sm:rtds-flex-wrap rtds-gap-2">
{% for ctaItem in cta %}
{% render '@button' ~ ctaItem.variant, ctaItem.context , true %}
{% endfor %}
</div>
{% endif %}
</div>
{% if iconPath %}
<div class="rtds-cta-banner__icon rtds-flex rtds-justify-center rtds-items-end rtds-p-4">
<img src="{{ iconPath | path }}" alt="" aria-hidden="true">
</div>
{% endif %}
{% block rightContent %}
{% endblock %}
</div>
</section>
{
"title": "Banner a due colonne",
"imgPath": "/images/banner-bg-icon.svg",
"ctaLabel": "Scopri di più<span class=\"rtds-sr-only\"> su ** TITOLO BANNER **</span>",
"contentWidth": "rtds-col-span-12",
"cta": [
{
"variant": "--icon-right",
"context": {
"classes": "rtds-btn--primary",
"href": "#",
"label": "Azione principale",
"icon": "mini--arrow-right"
}
}
],
"description": "Questa è la descrizione del banner che apparirà nella colonna di sinistra insieme al titolo, mentre i pulsanti CTA saranno posizionati nella colonna di destra.",
"hasShadow": true,
"classes": "rtds-background-03 rtds-cta-banner--bg-icon-right"
}
@layer components {
.rtds-cta-banner {
@apply rtds-grid rtds-rounded-xl rtds-min-h-36;
}
.rtds-cta-banner--img-bg {
@apply rtds-bg-cover rtds-bg-center rtds-relative rtds-overflow-hidden;
}
:where(.rtds-cta-banner--img-bg) .rtds-cta-banner__content {
@apply rtds-relative rtds-text-white;
}
/* manage overlay */
.rtds-cta-banner--img-bg {
@apply before:rtds-content-[''] before:rtds-absolute before:rtds-top-0 before:rtds-left-0 before:rtds-w-full before:rtds-h-full before:rtds-bg-black before:rtds-opacity-50;
}
/* ICON BG RIGHT */
.rtds-cta-banner--bg-icon-right {
@apply rtds-bg-no-repeat rtds-bg-[position:right_center];
}
.rtds-cta-banner--bg-sviluppo-toscana {
background-size: 5em;
background-position: right bottom 3em;
background-repeat: no-repeat;
}
.rtds-cta-banner--max-width {
max-width: 500px; /* o il valore che preferisci */
}
/* Opzionale: arrotonda gli angoli quando c'è il max-width */
.rtds-cta-banner--max-width {
border-radius: 8px; /* o il valore del tuo design system */
overflow: hidden; /* per mantenere il background-image dentro i bordi arrotondati */
}
/* ========================================
VARIANTE 2-COL-TEST
======================================== */
.rtds-cta-banner--2-col-test {
@apply rtds-rounded-2xl rtds-overflow-hidden;
background-position: center bottom;
background-size: auto 40%; /* o la dimensione che preferisci */
padding-bottom: 12rem; /* spazio per l'icona */
}
/* Desktop: icona torna a destra */
@screen lg {
.rtds-cta-banner--2-col-test {
background-position: right center;
background-size: auto 80%;
padding-bottom: 0;
}
}
}
Componente per la creazione di banner con call-to-action. Include supporto per immagini di sfondo e personalizzazione completa del layout.
Il componente CTA Banner è progettato per creare sezioni con un layout responsive e personalizzabile. Include:
Il componente è stato progettato seguendo le best practice di accessibilità WCAG 2.1:
<section>Il componente è strutturato come segue:
<section class="rtds-cta-banner [hasShadow] [classes] [imgBg]">
<div class="rtds-grid rtds-grid-cols-1 lg:rtds-grid-cols-12">
<div class="rtds-cta-banner__content">
<h2 class="rtds-heading-4">[title]</h2>
<div class="rtds-cta-banner__cta">
[CTA Button]
</div>
</div>
</div>
</section>title: Titolo del banner (obbligatorio)imgPath: Percorso dell’immagine di sfondoctaLabel: Testo del pulsante CTAimgBg: Booleano per attivare l’immagine di sfondo (default: false)hasShadow: Booleano per attivare l’ombra (default: false)classes: Classi CSS aggiuntive per il contenitorectaClasses: Classi CSS aggiuntive per il contenitore della ctacta: Configurazione del pulsante CTAvariant: Variante del pulsante (es. ‘–icon-right’)context: Contesto del pulsanteclasses: Classi CSS per il pulsantehref: URL di destinazionelabel: Testo del pulsanteIl componente include diverse possibilità di personalizzazione:
Ogni variante può essere utilizzata come base per personalizzazioni specifiche, mantenendo la coerenza con il design system.