IconProcess icon
Horizontale stappenrij met genummerd icoonblokje en verbindingslijn. Ideaal als procesoverzicht van 3-5 stappen.
src/components/icon/IconProcess.astro
---
/**
* IconProcess
* Horizontale stappenrij met genummerd icoonblokje en optionele verbindingslijn.
* Ideaal als procesoverzicht (4 stappen).
*
* Props:
* - headline?: string
* - sub?: string
* - steps: { icon?: string; title: string; description: string }[]
* - accentColor?: string default '#6366f1'
* - theme?: 'light' | 'dark' default 'light'
*/
interface Props {
headline?: string;
sub?: string;
steps: { icon?: string; title: string; description: string }[];
accentColor?: string;
theme?: 'light' | 'dark';
}
const { headline, sub, steps, accentColor = '#6366f1', theme = 'light' } = Astro.props;
---
<section class:list={['bl-section', 'iprc', `iprc--${theme}`]}>
<div class="bl-inner iprc-inner" style={`--color-accent: ${accentColor}`}>
{headline && <h2 class="iprc__title">{headline}</h2>}
{sub && <p class="iprc__sub">{sub}</p>}
<div class="iprc__steps">
{steps.map((step, i) => (
<div class="iprc__step">
<div class="iprc__head" aria-hidden="true">
<div class="iprc__icon-wrap">
{step.icon && <span class="iprc__icon">{step.icon}</span>}
<span class="iprc__num">{i + 1}</span>
</div>
{i < steps.length - 1 && <span class="iprc__connector" />}
</div>
<h3 class="iprc__name">{step.title}</h3>
<p class="iprc__body">{step.description}</p>
</div>
))}
</div>
</div>
</section>
<style>
.iprc--light { background: var(--color-bg, #fff); }
.iprc--dark { background: #0a0a0a; }
.iprc__title {
font-size: clamp(1.75rem, 3vw, 2.5rem);
font-weight: 700;
color: var(--color-primary, #0a0a0a);
text-align: center;
margin: 0 0 .75rem;
}
.iprc--dark .iprc__title { color: #e8e8e8; }
.iprc__sub {
font-size: 1.0625rem;
color: #6b7280;
text-align: center;
margin: 0 0 2.5rem;
line-height: 1.6;
}
.iprc--dark .iprc__sub { color: #aaa; }
.iprc__steps {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 0;
position: relative;
}
.iprc__step {
text-align: center;
padding: 0 1rem;
}
.iprc__head {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 1rem;
position: relative;
}
.iprc__icon-wrap {
position: relative;
width: 64px;
height: 64px;
border-radius: 50%;
background: color-mix(in srgb, var(--color-accent) 8%, #f8f8ff);
border: 2px solid color-mix(in srgb, var(--color-accent) 25%, transparent);
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
flex-shrink: 0;
z-index: 1;
}
.iprc--dark .iprc__icon-wrap {
background: color-mix(in srgb, var(--color-accent) 10%, #111);
border-color: color-mix(in srgb, var(--color-accent) 25%, transparent);
}
.iprc__num {
position: absolute;
top: -6px;
right: -6px;
width: 20px;
height: 20px;
background: var(--color-accent);
color: #fff;
border-radius: 50%;
font-size: .65rem;
font-weight: 800;
display: flex;
align-items: center;
justify-content: center;
}
.iprc__connector {
flex: 1;
height: 2px;
background: #e0e0f0;
margin-left: .5rem;
}
.iprc--dark .iprc__connector { background: #333; }
@media (max-width: 600px) {
.iprc__connector { display: none; }
}
.iprc__name {
font-size: 1rem;
font-weight: 700;
color: var(--color-primary, #0a0a0a);
margin: 0 0 .5rem;
}
.iprc--dark .iprc__name { color: #e8e8e8; }
.iprc__body {
font-size: .9rem;
color: #6b7280;
line-height: 1.6;
margin: 0;
}
.iprc--dark .iprc__body { color: #aaa; }
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
headline | string | - | Optionele sectiekop |
sub | string | - | Optionele subtekst |
steps * | { icon?: string; title: string; description: string }[] | - | Stap-items |
accentColor | string | '#6366f1' | Kleur voor icoonblokjes en nummerbadges |
theme | 'light' | 'dark' | 'light' | Achtergrondmodus |
* = verplicht