Image

Images with aspect ratios, captions, error fallbacks, and a built-in lightbox.

A starfield gradient
Captions wrap the image in a semantic figure.

Import#

import { Image } from "astralis-ui";
// Image.Group for galleries

Preview lightbox#

preview makes the image click-to-zoom — the lightbox supports zoom, rotate and keyboard dismissal, with arrow-key navigation inside an Image.Group.

Preview me

Click the image to preview

Error fallbacks#

BrokenBroken with custom fallback

Props#

PropTypeDefaultDescription
src / altstringrequiredSource and alt text.
aspectRatio"square" | "video" | "portrait" | "wide" or CSS ratioLocks the frame.
objectFit"cover" | "contain" | "fill" | "none" | "scale-down""cover"Fit inside the frame.
rounded"none""3xl" | "full""none"Corner radius.
loading"lazy" | "eager""lazy"Native lazy loading.
placeholder"blur" | "empty" or URL"empty"Shimmer or blurred stand-in while loading.
fallbackReactNodeiconRendered on load error.
captionReactNodeWraps in figure + figcaption.
previewbooleanfalseClick-to-zoom lightbox.

Image.Group#

PropTypeDefaultDescription
items{ src, alt, caption? }[]requiredThe gallery images.
columns2 | 3 | 43Grid columns.
gap"sm" | "md" | "lg""md"Grid gap.

Keyboard#

With the preview lightbox open:

KeyAction
EscClose the lightbox
/ Previous / next image (inside an Image.Group)