IconStack icon
Gestapelde diensten-lijst met icoon, titel en pill-categorie-tag per item. Geschikt als aanbod-stack of diensten-overzicht.
src/components/icon/IconStack.astro
---
/**
* IconStack
* Gestapelde lijst van diensten/items met icoon, titel en een pill-categorie-tag.
* Geschikt als diensten-overzicht of aanbod-stack.
*
* Props:
* - headline?: string
* - sub?: string
* - items: { icon?: string; title: string; tag?: string }[]
* - accentColor?: string default '#6366f1'
* - theme?: 'light' | 'dark' default 'light'
*/
interface Props {
headline?: string;
sub?: string;
items: { icon?: string; title: string; tag?: string }[];
accentColor?: string;
theme?: 'light' | 'dark';
}
const { headline, sub, items, accentColor = '#6366f1', theme = 'light' } = Astro.props;
---
<section class:list={['bl-section', 'istack', `istack--${theme}`]}>
<div class="bl-inner istack-inner" style={`--color-accent: ${accentColor}`}>
{headline && <h2 class="istack-headline">{headline}</h2>}
{sub && <p class="istack-sub">{sub}</p>}
<ul class="istack-list">
{items.map(item => (
<li class="istack-item">
{item.icon && <span class="istack-icon" aria-hidden="true">{item.icon}</span>}
<span class="istack-title">{item.title}</span>
{item.tag && <span class="istack-tag">{item.tag}</span>}
</li>
))}
</ul>
</div>
</section>
<style>
.istack--light { background: var(--color-bg, #fff); }
.istack--dark { background: #0a0a0a; }
.istack-headline {
font-size: clamp(1.5rem, 2.5vw, 2rem);
font-weight: 800;
color: var(--color-primary, #0a0a0a);
margin: 0 0 .75rem;
letter-spacing: -.02em;
}
.istack--dark .istack-headline { color: #e8e8e8; }
.istack-sub {
font-size: 1.0625rem;
color: #6b7280;
margin: 0 0 1.75rem;
line-height: 1.6;
}
.istack--dark .istack-sub { color: #aaa; }
.istack-list {
list-style: none;
margin: 0;
padding: 0;
max-width: 560px;
}
.istack-item {
display: flex;
align-items: center;
gap: .875rem;
padding: 1rem 0;
border-bottom: 1px solid #f3f4f6;
transition: opacity .15s;
}
.istack--dark .istack-item { border-bottom-color: #222; }
.istack-item:last-child { border-bottom: none; }
.istack-item:hover { opacity: .75; }
.istack-icon {
font-size: 1.2rem;
flex-shrink: 0;
width: 28px;
text-align: center;
}
.istack-title {
flex: 1;
font-size: .9375rem;
font-weight: 600;
color: var(--color-primary, #0a0a0a);
}
.istack--dark .istack-title { color: #e8e8e8; }
.istack-tag {
font-size: .75rem;
font-weight: 600;
color: var(--color-accent);
background: color-mix(in srgb, var(--color-accent) 8%, #f0f0ff);
padding: .1875rem .625rem;
border-radius: 99px;
white-space: nowrap;
}
.istack--dark .istack-tag {
background: color-mix(in srgb, var(--color-accent) 12%, #111);
}
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
headline | string | - | Optionele sectiekop |
sub | string | - | Optionele subtekst |
items * | { icon?: string; title: string; tag?: string }[] | - | Diensten-items met optioneel icoon en categorie-tag |
accentColor | string | '#6366f1' | Kleur van de categorie-tags |
theme | 'light' | 'dark' | 'light' | Achtergrondmodus |
* = verplicht