IconCircle icon
Rij ronde icoonknoppen met label, geschikt als diensten-navigator of categorie-picker.
src/components/icon/IconCircle.astro
---
interface CircleItem {
icon: string;
label: string;
href?: string;
size?: number;
}
interface Props {
items?: CircleItem[];
}
const {
items = [],
} = Astro.props;
---
<section class:list={['bl-section', 'ico-section']}>
<div class="bl-inner">
<div class="ico">
<div class="ico__row">
{items.map(item => (
item.href
? (
<a class="ico__item" href={item.href} aria-label={item.label} style={`--ico-size: ${item.size ?? 72}px`}>
<span class="ico__icon" aria-hidden="true">{item.icon}</span>
<span class="ico__label">{item.label}</span>
</a>
)
: (
<div class="ico__item" aria-label={item.label} style={`--ico-size: ${item.size ?? 72}px`}>
<span class="ico__icon" aria-hidden="true">{item.icon}</span>
<span class="ico__label">{item.label}</span>
</div>
)
))}
</div>
</div>
</div>
</section>
<style>
.ico-section { background: var(--color-bg, #fff); }
.ico__row { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.ico__item {
display: flex;
flex-direction: column;
align-items: center;
gap: .5rem;
text-decoration: none;
cursor: default;
}
a.ico__item { cursor: pointer; }
.ico__icon {
display: flex;
align-items: center;
justify-content: center;
width: var(--ico-size, 72px);
height: var(--ico-size, 72px);
border-radius: 50%;
background: #f0f0ff;
border: 2px solid rgba(99,102,241,.2);
font-size: calc(var(--ico-size, 72px) * .45);
transition: background .2s, transform .2s;
}
a.ico__item:hover .ico__icon { background: #6366f11f; transform: translateY(-3px); }
.ico__label {
font-size: .85rem;
font-weight: 600;
color: var(--color-primary, #0a0a0a);
}
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
items * | { icon: string; label: string; href?: string; size?: number }[] | - | Cirkel-items met icoon en label; href maakt het aanklikbaar |
* = verplicht