Image
An enterprise-level image component with support for lazy loading, preview, and error fallback.
Component Features
- 🖼️ Fit Modes: Supports
fill,contain,cover,none,scale-downobject-fit modes. - 🔍 Preview: Supports full-screen preview with zoom and rotation.
- ⚡ Lazy Loading: Supports lazy loading to defer loading off-screen images.
- 💧 Watermark: Supports adding watermarks to images.
- 🖼️ Error Fallback: Displays fallback content when image fails to load.
- 🎨 Theme Customization: Based on
BrConfigProviderfor global theming and TailwindCSS local overrides.
Basic Usage
Display a basic image.
Object Fit
Use the fit prop to control how the image should be resized to fit its container, just like the native object-fit CSS property.
Image Preview
Use the preview prop to enable a full-screen image preview. You can also provide an array of images to preview-src-list to allow cycling through multiple images.
Lazy Loading
Use the lazy prop to defer loading the image until it enters the viewport. A skeleton screen is automatically displayed while the image is loading.
Watermark
Use the watermark prop to add a watermark to the image. You can pass a string or a configuration object.
Error Fallback
When an image fails to load, a default error fallback will be displayed automatically.