IconSplit icon
Twee-koloms grid van icoon + titel + beschrijving items. Geschikt als feature-overzicht of diensten-grid.
src/components/icon/IconSplit.astro
---
/**
* IconSplit
* Twee-koloms grid van icoon + titel + beschrijving items.
* Geschikt als feature-overzicht of diensten-grid.
*
* Props:
* - headline?: string
* - sub?: string
* - items: { icon?: string; title: string; description: string }[]
* - accentColor?: string default '#6366f1'
* - theme?: 'light' | 'dark' default 'light'
*/
interface Props {
headline?: string;
sub?: string;
items: { icon?: string; title: string; description: string }[];
accentColor?: string;
theme?: 'light' | 'dark';
}
const { headline, sub, items, accentColor = '#6366f1', theme = 'light' } = Astro.props;
---
<section class:list={['bl-section', 'ispl', `ispl--${theme}`]}>
<div class="bl-inner ispl-inner" style={`--color-accent: ${accentColor}`}>
{headline && <h2 class="ispl-headline">{headline}</h2>}
{sub && <p class="ispl-sub">{sub}</p>}
<div class="ispl-grid">
{items.map(item => (
<div class="ispl-item">
{item.icon && <span class="ispl-icon" aria-hidden="true">{item.icon}</span>}
<div class="ispl-text">
<h3 class="ispl-title">{item.title}</h3>
<p class="ispl-desc">{item.description}</p>
</div>
</div>
))}
</div>
</div>
</section>
<style>
.ispl--light { background: var(--color-bg, #fff); }
.ispl--dark { background: #0a0a0a; }
.ispl-headline {
font-size: clamp(1.75rem, 3vw, 2.25rem);
font-weight: 800;
color: var(--color-primary, #0a0a0a);
margin: 0 0 .75rem;
letter-spacing: -.02em;
}
.ispl--dark .ispl-headline { color: #e8e8e8; }
.ispl-sub {
font-size: 1.0625rem;
color: #6b7280;
margin: 0 0 2rem;
line-height: 1.6;
}
.ispl--dark .ispl-sub { color: #aaa; }
.ispl-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.25rem 2rem;
}
@media (max-width: 600px) {
.ispl-grid { grid-template-columns: 1fr; }
}
.ispl-item {
display: flex;
gap: .875rem;
align-items: flex-start;
}
.ispl-icon {
font-size: 1.4rem;
flex-shrink: 0;
margin-top: 2px;
}
.ispl-text { flex: 1; }
.ispl-title {
margin: 0 0 .25rem;
font-size: 1rem;
font-weight: 700;
color: var(--color-primary, #0a0a0a);
}
.ispl--dark .ispl-title { color: #e8e8e8; }
.ispl-desc {
margin: 0;
font-size: .9rem;
line-height: 1.6;
color: #6b7280;
}
.ispl--dark .ispl-desc { color: #aaa; }
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
headline | string | - | Optionele sectiekop |
sub | string | - | Optionele subtekst |
items * | { icon?: string; title: string; description: string }[] | - | Feature-items |
accentColor | string | '#6366f1' | Kleur van de iconen |
theme | 'light' | 'dark' | 'light' | Achtergrondmodus |
* = verplicht