ImageBanner image
Horizontale bannersectie met foto-achtergrond, gradient overlay, kop en subtekst.
src/components/image/ImageBanner.astro
---
interface Props {
src?: string;
alt?: string;
headline?: string;
sub?: string;
minHeight?: string;
}
const {
src = '/img/ext/photo-1460925895917-afdab827c52f-w1400-b35092.jpg',
alt = 'Marketing team aan het werk',
headline = 'Data-driven marketing',
sub = 'Groei die zichtbaar is in je cijfers.',
minHeight = '380px',
} = Astro.props;
---
<section class="bl-section ibann" style={`--ibann-min-height: ${minHeight}`}>
<div class="ibann__img-wrap">
<img data-allow-img class="ibann__img" src={src} alt={alt} loading="lazy" decoding="async" />
<div class="ibann__overlay"></div>
</div>
<div class="bl-inner ibann__content">
<h2 class="ibann__headline">{headline}</h2>
{sub && <p class="ibann__sub">{sub}</p>}
</div>
</section>
<style>
.ibann {
position: relative;
min-height: var(--ibann-min-height, 380px);
overflow: hidden;
display: flex;
align-items: center;
padding-block: 0;
}
.ibann__img-wrap {
position: absolute;
inset: 0;
}
.ibann__img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.ibann__overlay {
position: absolute;
inset: 0;
background: linear-gradient(to bottom, rgba(10, 10, 10, 0.35), rgba(10, 10, 10, 0.65));
}
.ibann__content {
position: relative;
z-index: 1;
padding-block: var(--bl-section-py);
}
.ibann__headline {
font-size: clamp(1.5rem, 3.5vw, 2.75rem);
font-weight: 800;
color: #fff;
margin: 0 0 0.6rem;
line-height: 1.15;
letter-spacing: -0.02em;
text-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
max-width: 640px;
}
.ibann__sub {
font-size: 1.05rem;
color: #e8e8e8;
margin: 0;
line-height: 1.5;
max-width: 520px;
}
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
src | string | - | URL van de bannerafbeelding |
alt | string | "Marketing team aan het werk" | Alt-tekst van de afbeelding |
headline | string | - | Kop over de afbeelding |
sub | string | - | Subtekst onder de kop |
minHeight | string | "380px" | Minimale hoogte van de banner |
* = verplicht