# Image Image component displays photographic or illustrative content in a consistent and responsive manner. It supports configurable aspect ratios, corner styles, and overlays to maintain visual consistency across interfaces. **Category:** Components **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-image--introduction ## Variants documented in Storybook - SharpRatios: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-image--sharpratios - RoundedRatios: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-image--roundedratios ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for Image. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Introduction — Introduction HTML: ```html
Image component displays photographic or illustrative content in a consistent and responsive manner. It supports configurable aspect ratios, corner styles, and overlays to maintain visual consistency across interfaces.
Visual demonstration of various aspect ratios and semantic overlays.
Quickly copy aspect ratio and treatment utilities for images.
ux4g-ratio-1-1
|
ux4g-ratio-4-3
|
ux4g-ratio-3-2
|
ux4g-ratio-16-10
|
ux4g-ratio-16-9
|
ux4g-ratio-2-1
|
ux4g-ratio-5-2
|
ux4g-ratio-3-1
|
ux4g-ratio-2-3
|
ux4g-ratio-3-4
|
|
Rounded Corners (12px)
ux4g-img-rounded
|
|
Overlay Container
ux4g-img-overlay
|
|
Overlay Position Top
ux4g-img-overlay-top
|
|
Overlay Position Bottom
ux4g-img-overlay-bottom
|
|
Full Height Overlay (on position)
ux4g-h-100
|
Image component displays photographic or illustrative content in a consistent and responsive manner. It supports configurable aspect ratios, corner styles, and overlays to maintain visual consistency across interfaces.
Visual demonstration of various aspect ratios and semantic overlays.
{/* Sharp Showcase */}Quickly copy aspect ratio and treatment utilities for images.
ux4g-ratio-1-1
|
ux4g-ratio-4-3
|
ux4g-ratio-3-2
|
ux4g-ratio-16-10
|
ux4g-ratio-16-9
|
ux4g-ratio-2-1
|
ux4g-ratio-5-2
|
ux4g-ratio-3-1
|
ux4g-ratio-2-3
|
ux4g-ratio-3-4
|
|
Rounded Corners (12px)
ux4g-img-rounded
|
|
Overlay Container
ux4g-img-overlay
|
|
Overlay Position Top
ux4g-img-overlay-top
|
|
Overlay Position Bottom
ux4g-img-overlay-bottom
|
|
Full Height Overlay (on position)
ux4g-h-100
|
Image component displays photographic or illustrative content in a consistent and responsive manner. It supports configurable aspect ratios, corner styles, and overlays to maintain visual consistency across interfaces.
Visual demonstration of various aspect ratios and semantic overlays.
Quickly copy aspect ratio and treatment utilities for images.
ux4g-ratio-1-1
|
ux4g-ratio-4-3
|
ux4g-ratio-3-2
|
ux4g-ratio-16-10
|
ux4g-ratio-16-9
|
ux4g-ratio-2-1
|
ux4g-ratio-5-2
|
ux4g-ratio-3-1
|
ux4g-ratio-2-3
|
ux4g-ratio-3-4
|
|
Rounded Corners (12px)
ux4g-img-rounded
|
|
Overlay Container
ux4g-img-overlay
|
|
Overlay Position Top
ux4g-img-overlay-top
|
|
Overlay Position Bottom
ux4g-img-overlay-bottom
|
|
Full Height Overlay (on position)
ux4g-h-100
|