Skip to content

Ambient Image

The AmbientImage component is used to display images in a visually appealing manner by generating an ambient glow background effect that replicates and blurs the dominant colors of the image. This creates an environmental radiance effect that helps the image blend better with its surroundings.

Since OrbitUI components are copied directly into your project, you’ll add the AmbientImage component using the OrbitUI CLI:

Terminal window
npx orbitkit@latest add button-group

Import the AmbientImage and AmbientFigcaption components and use them in your Astro components or pages. It’s important to provide the src, alt, and width (or height) attributes for the image to load correctly.

Dock Under Cloudy Sky in Front of Mountain

Dock Under Cloudy Sky in Front of Mountain

Lake and Mountain

The AmbientImage component accepts standard HTML attributes for <figure>, plus key HTML attributes for <img>, and several optional properties to customize the ambient effect.

PropTypeDefault
srcstring""
altstring""
widthnumberundefined
heightnumberundefined
loadinglazy, eager, undefinedundefined
blurnumber15
saturatenumber150
contrastnumber100
brightnessnumber100
opacitynumber80
classstring''
  • src: Required,The URL of the image to display.
  • alt: Required,Descriptive alternative text for the image.
  • width: The width of the image. Must specify either width or height.
  • height: The height of the image. Must specify either width or height.
  • loading: Image loading behavior (e.g., for optimization).
  • blur: The degree of blur applied to the background (in pixels).
  • saturate: Color saturation multiplier for the background (as a percentage).
  • contrast,Contrast multiplier for the background (as a percentage).
  • brightness: Brightness multiplier for the background (as a percentage).
  • opacity: Opacity of the background (as a percentage).

The AmbientFigcaption component is used to provide a concise caption within the AmbientImage container. Supports any standard HTML <figcaption> tag attributes.