ImageProfile image
Profielkaart met ronde avatar, naam, functietitel, bio en optionele link. Voor team-secties.
src/components/image/ImageProfile.astro
---
interface Props {
src?: string;
alt?: string;
name: string;
role?: string;
bio?: string;
link?: { label: string; href: string };
}
const {
src,
alt,
name,
role,
bio,
link,
} = Astro.props;
---
<section class="bl-section ipr-section">
<div class="bl-inner">
<div class="ipr">
<div class="ipr__avatar">
{src
? <img data-allow-img class="ipr__img" src={src} alt={alt ?? name} loading="lazy" decoding="async" />
: <div class="ipr__placeholder" aria-label={alt ?? name}></div>
}
</div>
<div class="ipr__info">
<p class="ipr__name">{name}</p>
{role && <p class="ipr__role">{role}</p>}
{bio && <p class="ipr__bio">{bio}</p>}
{link && <a class="ipr__link" href={link.href}>{link.label}</a>}
</div>
</div>
</div>
</section>
<style>
.ipr {
display: flex;
align-items: flex-start;
gap: 1.5rem;
padding: 1.5rem;
background: #fff;
border: 1px solid #eee;
border-radius: 12px;
}
.ipr__avatar {
flex-shrink: 0;
width: 80px;
height: 80px;
border-radius: 50%;
overflow: hidden;
border: 3px solid var(--color-accent, #6366f1);
}
.ipr__img {
width: 100%;
height: 100%;
object-fit: cover;
}
.ipr__placeholder {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #c8c8f0, #a0a0e0);
}
.ipr__info {
flex: 1;
}
.ipr__name {
font-size: 1.1rem;
font-weight: 700;
color: var(--color-primary, #0a0a0a);
margin: 0 0 0.2rem;
}
.ipr__role {
font-size: 0.85rem;
font-weight: 600;
color: var(--color-accent, #6366f1);
margin: 0 0 0.75rem;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.ipr__bio {
font-size: 0.9rem;
color: #555;
line-height: 1.6;
margin: 0 0 0.75rem;
}
.ipr__link {
font-size: 0.875rem;
font-weight: 600;
color: var(--color-accent, #6366f1);
text-decoration: none;
}
.ipr__link:hover {
text-decoration: underline;
}
</style>
Props
| Prop | Type | Default | Beschrijving |
|---|---|---|---|
src | string | - | URL van de profielfoto |
alt | string | - | Alt-tekst van de profielfoto |
name * | string | - | Naam van de persoon |
role | string | - | Functietitel |
bio | string | - | Korte biografie |
link | { label: string; href: string } | - | Optionele link (bijv. LinkedIn) |
* = verplicht