Image
A responsive image with a layout-stable box, srcset and sizes, focal point, placeholder and fallback, built on the native <img> and <picture> elements.
The box reserves the aspect ratio before the file arrives, so the surrounding layout never shifts. `widths` and `transform` build the srcset, `sizes` lets the browser choose a candidate, and the placeholder stays visible until the image loads. `placeholder` is either a CSS color or an image URL drawn cover/center; decode a blurhash to a low-quality image URL first. The component is a native `<img>` (or `<picture>` when `sources` is set), so it works in every framework and can be replaced by a framework image component without changing the rest of the page.
Preview

Installation
Add the item with the shadcn CLI, or copy the source manually.
pnpm dlx shadcn@latest add litingyes/blocove/imageRequires a shadcn/ui project set up with Base UI primitives. Blocove is developed against the b0 preset, but it installs no base config or theme tokens: your own preset, fonts and colors stay in place.
Or install from the namespace after adding the registry: npx shadcn@latest add @blocove/image
API Reference
Props accepted by the exported components.
Image
The responsive image. The box keeps the aspect ratio, paints the placeholder and exposes `data-state`; the `<img>` inside stays a plain native element.
| Prop | Type | Default |
|---|---|---|
src | string | Required |
alt | string | Required |
width | number | - |
height | number | - |
aspectRatio | number | string | width / height |
srcSet | string | - |
sizes | string | - |
widths | readonly number[] | - |
transform | (src, width) => string | Identity |
sources | readonly ImageSource[] | - |
priority | boolean | false |
focalPoint | { x: number, y: number } | - |
objectFit | CSSProperties['objectFit'] | 'cover' |
placeholder | string | - |
fallback | ReactNode | - |
containerClassName | string | - |
className | string | - |
...props | ImgHTMLAttributes<HTMLImageElement> | - |