# Image
A responsive image with a layout-stable box, srcset and sizes, focal point, placeholder and fallback, built on the native
and elements.
## Installation
```bash
npx shadcn@latest add litingyes/blocove/image
```
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 `
` (or `` 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.
## API Reference
### Image
The responsive image. The box keeps the aspect ratio, paints the placeholder and exposes `data-state`; the `
` 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` | - |
## Registry dependencies
- `litingyes/blocove/image-pipeline`
Namespace: `npx shadcn@latest add @blocove/image`