Zephora UI

Data

Image

Enhanced img element with error fallback, fixed aspect ratio, object-fit control, lazy loading and a full-screen preview lightbox with zoom.

Import

import { Image } from "@zephora/react";

Examples

Aspect ratio and fit

Purple abstract artwork

Fallback

`fallback` renders instead of the image when loading fails.

Missing photo

Preview lightbox

With `preview`, click (or Enter) opens a modal lightbox with zoom in/out and close controls.

API

Image props

PropTypeDefaultDescription
srcstring—Image source URL.
alt *string—Alternative text — required for accessibility.
fallbackReactNode—Rendered instead of the image when it fails to load.
aspectRationumber—Fixed width/height ratio applied to the wrapper (e.g. 16 / 9).
fit"cover" | "contain" | "fill""cover"Object-fit behavior.
radiusnumber | string—Corner radius (px number or any CSS length).
lazybooleanfalseUses native loading="lazy".
previewbooleanfalseClick (or Enter) opens a full-screen lightbox with zoom controls.
unstyledbooleanfalseHeadless mode — skips Zephora styling.

Keyboard

KeyAction
Enter / SpaceOpens the preview lightbox when `preview` is set.
EscapeCloses the preview lightbox (focus is trapped inside).