Resilient image with a two-step fallback chain, intrinsic dimensions and an LCP priority flag.
Design intent
Organizer images are hotlinked and periodically 403, move, or die. Image keeps cards and banners free of broken-image boxes and layout shift by always emitting intrinsic dimensions, trying a known-good fallback source, and finally rendering consumer-provided fallback content. Priority is opt-in for the one above-the-fold image per page.
npx @slipstream-ui/cli@latest add imageBroken src, fallbackSrc

Every URL failed

Above-the-fold hero: priority, explicit 16:9 box
The width and height attributes reserve the 16:9 box before the file arrives, so nothing moves.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| src | string | — | Primary image URL. Hotlinked sources are expected. |
| alt | string | — | Required: describes the image content, not the component. |
| fallbackSrc | string | — | Second URL tried before the fallback node, such as generated placeholder art. |
| fallback | React.ReactNode | — | Content rendered when every URL has failed (icon, initials, empty panel). |
| priority | boolean | false | Load eagerly and fetch at high priority for the one above-the-fold image. |
| width | number | 1200 | Intrinsic width, always emitted so the browser reserves space. |
| height | number | 630 | Intrinsic height, always emitted so the browser reserves space. |
| className | string | — | Classes for the image. |
| imgClassName | string | — | Extra classes merged after className. |
| style | React.CSSProperties | — | Inline styles for the image. |
Anti-patterns
validate_usage is the MCP tool that rejects these mistakes: the same list agents see over MCP and in the canonical markdown.
Don't omit width and height
Without intrinsic dimensions the browser cannot reserve space and a failed image shifts the page. The defaults exist so there is no reason to omit them; override them to the real aspect ratio.
tsx// Avoid: no dimensions<Image src={src} alt={alt} />// Prefer: real aspect ratio<Image src={src} alt={alt} width={1200} height={630} />Don't set priority on every image
Only one image should compete for LCP priority. Marking a grid eager delays everything else.
tsx// Avoid: every card eageritems.map((item) => <Image priority ... />)// Prefer: first item onlyitems.map((item, index) => <Image priority={index === 0} ... />)Don't describe the component in alt text
Alt text describes the content. Screen readers already announce that it is an image.
tsx// Avoid: <Image alt="Image of a dancer" />// Prefer: <Image alt="Dancer mid-turn on the floor" />
Accessibility
- alt is required by the type; describe the image, not the component.
- Intrinsic width and height are always emitted, so a failed or slow image never shifts the layout.
- Only the priority image loads eagerly; every other image is lazy and decodes asynchronously.
- Fallback content should carry the same information as the image, not a second description.
- Set alt="" on a decorative image whose fallback already shows the message.
Composition
Related components: ArticleCard, EntityCard, Hero, PageHeader
Dependencies
What the registry installs alongside this component. Package imports already include these.
npm packages
- class-variance-authority
- clsx
- tailwind-merge
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+: macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA, the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.