Responsive content image
Render a responsive image with meaningful alternative text.
<Image
src="/showcase-images/violet-circle.svg"
alt="Abstract violet circle on a dark surface"
width="800"
height="450"
/>
// Generated by scripts/generate-showcase.mjs. Do not edit directly.
page ImageDetail {
layout = "showcase"
state playground_size = ctx.url.searchParams.get("pg_size") ?? "default"
state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary"
state playground_src = ctx.url.searchParams.get("pg_src") ?? ""
state playground_alt = ctx.url.searchParams.get("pg_alt") ?? ""
state playground_width = ctx.url.searchParams.get("pg_width") ?? ""
state playground_height = ctx.url.searchParams.get("pg_height") ?? ""
state playground_loading = ctx.url.searchParams.get("pg_loading") ?? "lazy"
state playground_fit = ctx.url.searchParams.get("pg_fit") ?? "cover"
state playground_rounded = (ctx.url.searchParams.get("pg_rounded") ?? "false") === "true"
state playground_class = ctx.url.searchParams.get("pg_class") ?? "showcase-instance showcase-instance--1"
seo {
title = "Image"
description = "Render a responsive image with explicit dimensions, loading behavior, alternative text, sizing, and rounded treatment."
}
view {
Render a responsive image with explicit dimensions, loading behavior, alternative text, sizing, and rounded treatment. Change any prop and inspect the server-rendered component immediately.Image
Configure Image
<Image />
Compare configurations and resize the browser to check responsive behavior.
Render a responsive image with meaningful alternative text.
<Image
src="/showcase-images/violet-circle.svg"
alt="Abstract violet circle on a dark surface"
width="800"
height="450"
/>
Use a rounded image in cards, directories, and compact summaries.
<Image
size="sm"
src="/showcase-images/blue-mountain.svg"
alt="Abstract blue thumbnail"
width="400"
height="400"
rounded="true"
/>
Use explicit dimensions and eager loading for an above-the-fold visual.
<Image
size="lg"
src="/showcase-images/green-hero.svg"
alt="Abstract green hero visual"
width="1200"
height="600"
loading="eager"
rounded="true"
/>
All content and behavior shown above is supplied through these props and slots.
| Prop | Type | Default | Required |
|---|---|---|---|
size | string | "default" | No |
color | string | "primary" | No |
src | string | "" | No |
alt | string | "" | No |
width | string | "" | No |
height | string | "" | No |
loading | string | "lazy" | No |
fit | string | "cover" | No |
rounded | boolean | false | No |
class | string | "" | No |