Media
Image
A wrapper around an image. It handles lazy loading, a fade-in, a fixed aspect ratio, and a fallback when loading fails.
ReactVueWeb Components
View in Storybook Playground
Examples
<Image src="/p.jpg" alt="製品" ratio={16 / 9} rounded /> Props
| Name | Type | Default | Description |
|---|---|---|---|
src required | string | — | Image source. |
alt required | string | — | Required alternative text. |
fallback | ReactNode | — | Content shown if the image fails to load. @default the alt text |
ratio | number | [number, number] | — | Fixed aspect ratio as `w/h` (e.g. `16/9`) or `[w, h]`. |
rounded | boolean | false | Rounded corners. @default false |
Accessibility
- Body/background contrast is ≥ 7:1 (AAA) in both light and dark.
- Every interaction works with the keyboard alone.
- The focus ring is always visible.
- Respects prefers-reduced-motion and stops excessive motion.
Every component is designed to meet WCAG 2.1 AAA.