diff --git a/CHANGELOG.md b/CHANGELOG.md index d059ac22ed0..c1a886700ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Added `Enter` key press functionality to `EuiSuperDatePicker` ([#3048](https://github.com/elastic/eui/pull/3048)) - Added `title` to headers of `EuiTable` in case of truncation ([#3094](https://github.com/elastic/eui/pull/3094)) - Added i18n to `EuiTableHeaderCell` ([#3094](https://github.com/elastic/eui/pull/3094)) +- Added `number` and `string` to `size` type of `EuiImage` for setting custom sizes ([#3012](https://github.com/elastic/eui/pull/3012)) **Bug Fixes** diff --git a/src-docs/src/views/image/image_example.js b/src-docs/src/views/image/image_example.js index d2232cbbc40..2bef54d0f2c 100644 --- a/src-docs/src/views/image/image_example.js +++ b/src-docs/src/views/image/image_example.js @@ -30,7 +30,7 @@ const imageZoomSource = require('!!raw-loader!./image_zoom'); const imageZoomHtml = renderToHtml(ImageZoom); const imageZoomSnippet = ` `; @@ -53,39 +53,8 @@ export const ImageExample = {

Use EuiImage when you need to place a static - image into a page with an optional caption. It has the following - props. + image into a page with an optional caption.

-
), props: { EuiImage }, @@ -131,8 +100,14 @@ export const ImageExample = { text: (

Images can be sized by passing the size prop a - value of s / m / l / xl / original / fullWidth. - Note that this size is applied to the width of the image. + value of{' '} + + s / m / l / xl / original / fullWidth / number / string + + . This size sets the maximum length of the longest + edge of the image, whether that is height or width, and scales it. + Only the provided sizing values will also increase the size of a + smaller image.

), demo: , diff --git a/src-docs/src/views/image/image_size.js b/src-docs/src/views/image/image_size.js index 1c84bc9ae69..0212adadb0c 100644 --- a/src-docs/src/views/image/image_size.js +++ b/src-docs/src/views/image/image_size.js @@ -4,6 +4,15 @@ import { EuiImage, EuiSpacer } from '../../../../src/components'; export default () => (
+ + alt @@ -173,7 +212,13 @@ export class EuiImage extends Component { } else { return (
- {alt} + {alt} {optionalCaption}
);