Primitives
Logo
The site logo, rendered as text, an image, or a vector.
The Logo primitive wraps a link/button around either a vector or an image and an optional label.
Default (label)
---
import Logo from '@alfadormx/blocks/primitives/Logo.astro';
---
<div class="flex items-center gap-4">
<Logo />
</div>Vector (SVG)
Image (raster)
Used when vector.src is not set. Supply width and height (or an aspectRatio) so the image optimizer can generate the rendered sources. alt falls back to the site name.
Label only (text)
---
import Logo from '@alfadormx/blocks/primitives/Logo.astro';
---
<div class="flex items-center gap-4">
<Logo label="Simple Text Logo" labelClass="text-lg font-semibold" />
</div>Custom classes
---
import Logo from '@alfadormx/blocks/primitives/Logo.astro';
---
<div class="flex items-center gap-4">
<Logo
label="Styled"
class="p-2 text-accent"
vector={{
src: 'https://www.svgrepo.com/show/513167/basketball.svg',
ariaLabel: 'Basketball',
}}
labelClass="text-xl font-bold"
/>
</div>Notes
vector takes precedence over image — when both have a src, only the vector renders. Setting either one suppresses the default site-name label.
Logo renders its vector or image into the Button slot, so neither is forwarded to the Button’s own icon / image media slot. Every other prop is passed through to the Button primitive, so variant, intent, size, href and class behave exactly as they do there.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| vector | VectorProps | — | Props for rendering the logo as an SVG vector; when its `src` is set, it takes precedence over `image` inside the Button. |
| image | ImageProps | — | Props for rendering the logo as a raster image inside the Button slot; used when `vector.src` is not provided. Replaces Button's own `image` media slot. |