Show · Image

Image

Used to display and preview images.

Demos

How to import

<script setup lang="ts">
    import { Image, ImagePreview } from '@fibrous/semi-ui-vue';
</script>

Basic usage

You can get an image with preview function by specifying the image path through src, and specify the width and height of the image through width, height

Abstract colorful artwork
Code
<script setup lang="ts">
    import { Image } from '@fibrous/semi-ui-vue';
</script>

<template>
    <Image alt="Abstract colorful artwork" :height="200" src="/assets/root-web-sites/abstract.jpg" :width="360" />
</template>

Loading failed placeholder

fallback takes the URL of the image shown when loading fails (a string). For custom content use the #fallback slot, which takes precedence when both are given

加载失败默认样式
加载失败的图片

自定义加载失败占位图
加载失败的图片
Code
<script setup lang="ts">
    import { IconUploadError } from '@fibrous/semi-icons-vue';
    import { Image } from '@fibrous/semi-ui-vue';
</script>

<template>
    <div :style="{ display: 'flex', alignItems: 'center', flexDirection: 'column' }">
        <span>加载失败默认样式</span>
        <Image alt="加载失败的图片" :height="200" src="https://load-error.jpeg" :width="200" />
        <br />
        <span>自定义加载失败占位图</span>
        <Image alt="加载失败的图片" :height="200" src="https://load-error.jpeg" :width="200">
            <template #fallback>
                <IconUploadError :style="{ fontSize: '50px' }" />
            </template>
        </Image>
    </div>
</template>

Progressive loading

Large images can be progressively loaded through the #placeholder slot

Abstract colorful artwork

Code
<script setup lang="ts">
    import { ref } from 'vue';
    import { Button, Image } from '@fibrous/semi-ui-vue';

    const timestamp = ref('');
</script>

<template>
    <Image alt="Abstract colorful artwork" :height="200" :src="`/assets/root-web-sites/abstract-big.png?${timestamp}`" :width="300">
        <template #placeholder>
            <Image alt="" :height="200" :preview="false" src="/assets/root-web-sites/abstract-small.jpeg" :width="300" />
        </template>
    </Image>
    <br />
    <Button :style="{ marginTop: '10px' }" theme="solid" @click="timestamp = String(Date.now())">Reload</Button>
</template>

Customize the preview image

You can customize the preview image by setting the src of the Image component to be different from the src in the preview parameter

Abstract colorful artwork
Code
<script setup lang="ts">
    import { Image } from '@fibrous/semi-ui-vue';

    const preview = {
        src: '/assets/root-web-sites/abstract-big.png',
    };
</script>

<template>
    <Image alt="Abstract colorful artwork" :height="200" :preview="preview" src="/assets/root-web-sites/abstract-small.jpeg" :width="300" />
</template>

Multi-image preview

Use ImagePreview to wrap Image to achieve multi-image preview

lamp1
lamp2
lamp3
lamp4
Code
<script setup lang="ts">
    import { Image, ImagePreview } from '@fibrous/semi-ui-vue';

    const srcList = ['/assets/root-web-sites/abstract.jpg', '/assets/root-web-sites/sky.jpg', '/assets/root-web-sites/greenleaf.jpg', '/assets/root-web-sites/colorful.jpg'];
</script>

<template>
    <ImagePreview>
        <Image v-for="(src, index) in srcList" :key="src" :alt="`lamp${index + 1}`" :src="src" :style="{ marginRight: '5px' }" :width="200" />
    </ImagePreview>
</template>

Use the preview component alone

The preview component ImagePreview can be used alone, through v-model:visible (or visible with @visibleChange) to control whether to preview, src to pass in the image that can be previewed, and previewTitle (a string) to set the title at the top of the preview


Code
<script setup lang="ts">
    import { ref } from 'vue';
    import { Button, ImagePreview } from '@fibrous/semi-ui-vue';

    const srcList = ['/assets/root-web-sites/abstract.jpg', '/assets/root-web-sites/sky.jpg', '/assets/root-web-sites/greenleaf.jpg', '/assets/root-web-sites/colorful.jpg'];

    const visible1 = ref(false);
    const visible2 = ref(false);
</script>

<template>
    <Button @click="visible1 = true">Preview single Image</Button>
    <ImagePreview v-model:visible="visible1" src="/assets/root-web-sites/sky.jpg" />
    <br />
    <Button :style="{ marginTop: '20px' }" @click="visible2 = true">Preview multiple Images</Button>
    <ImagePreview v-model:visible="visible2" previewTitle="Scenery" :src="srcList" />
</template>

Render in the specified container

You can specify the parent DOM of the preview component through getPopupContainer (you need to specify position: relative), and the image preview will be rendered into this DOM. This will change the DOM tree position, but not the view's rendering position.

When the container is not document.body (including a getPopupContainer set only on ConfigProvider), the preview is non-modal: it does not output aria-modal, does not trap Tab and does not lock page scrolling. Returning document.body from getPopupContainer is the same as not passing it.

lamp1
lamp2
lamp3
Code
<script setup lang="ts">
    import { useTemplateRef } from 'vue';
    import { Image, ImagePreview } from '@fibrous/semi-ui-vue';

    const srcList = ['/assets/root-web-sites/abstract.jpg', '/assets/root-web-sites/sky.jpg', '/assets/root-web-sites/greenleaf.jpg'];

    const container = useTemplateRef<HTMLDivElement>('container');
    // called when the preview opens, after the container is mounted
    const getPopupContainer = () => container.value as HTMLElement;
</script>

<template>
    <div ref="container" :style="{ height: '400px', position: 'relative' }">
        <ImagePreview :getPopupContainer="getPopupContainer" :style="{ height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }">
            <Image v-for="(src, index) in srcList" :key="src" :alt="`lamp${index + 1}`" :src="src" :style="{ marginRight: '5px' }" :width="200" />
        </ImagePreview>
    </div>
</template>

Customize the bottom operation area of the preview

The bottom action area of the preview can be customized with the #previewMenu slot, which receives MenuProps. Images wrapped by ImagePreview use the slot of ImagePreview; a standalone Image uses its own slot of the same name

lamp1
lamp2
lamp3
Code
<script setup lang="ts">
    import { IconChevronLeft, IconChevronRight, IconDownload, IconMinus, IconPlus, IconRealSizeStroked, IconRotate, IconWindowAdaptionStroked } from '@fibrous/semi-icons-vue';
    import { Button, Image, ImagePreview } from '@fibrous/semi-ui-vue';

    const srcList = ['/assets/root-web-sites/abstract.jpg', '/assets/root-web-sites/sky.jpg', '/assets/root-web-sites/greenleaf.jpg'];
</script>

<template>
    <ImagePreview>
        <template #previewMenu="{ ratio, disabledPrev, disabledNext, disabledZoomIn, disabledZoomOut, disableDownload, onDownload, onNext, onPrev, onRotateLeft, onRatioClick, onZoomIn, onZoomOut }">
            <div
                :style="{
                    background: 'grey',
                    height: '40px',
                    width: '280px',
                    display: 'flex',
                    alignItems: 'center',
                    justifyContent: 'space-around',
                    borderRadius: '3px',
                }"
            >
                <Button aria-label="上一张" :disabled="disabledPrev" type="tertiary" @click="onPrev">
                    <template #icon>
                        <IconChevronLeft size="large" />
                    </template>
                </Button>
                <Button aria-label="下一张" :disabled="disabledNext" type="tertiary" @click="onNext">
                    <template #icon>
                        <IconChevronRight size="large" />
                    </template>
                </Button>
                <Button aria-label="缩小" :disabled="disabledZoomOut" type="tertiary" @click="onZoomOut">
                    <template #icon>
                        <IconMinus size="large" />
                    </template>
                </Button>
                <Button aria-label="放大" :disabled="disabledZoomIn" type="tertiary" @click="onZoomIn">
                    <template #icon>
                        <IconPlus size="large" />
                    </template>
                </Button>
                <Button :aria-label="ratio === 'adaptation' ? '原始尺寸' : '适应页面'" type="tertiary" @click="onRatioClick">
                    <template #icon>
                        <IconRealSizeStroked v-if="ratio === 'adaptation'" size="large" />
                        <IconWindowAdaptionStroked v-else size="large" />
                    </template>
                </Button>
                <Button aria-label="旋转" type="tertiary" @click="onRotateLeft">
                    <template #icon>
                        <IconRotate size="large" />
                    </template>
                </Button>
                <Button aria-label="下载" :disabled="disableDownload" type="tertiary" @click="onDownload">
                    <template #icon>
                        <IconDownload size="large" />
                    </template>
                </Button>
            </div>
        </template>
        <Image v-for="(src, index) in srcList" :key="src" :alt="`lamp${index + 1}`" :src="src" :style="{ marginRight: '5px' }" :width="200" />
    </ImagePreview>
</template>

If you want to customize the bottom operation area based on the default one, use the menuItems slot parameter: an array of the default items as VNodes, in the order previous, page counter, next, zoom out, zoom slider, zoom in, original size / fit to page, rotate and download. Render them with <component :is>

lamp1
lamp2
lamp3
Code
<script setup lang="ts">
    import { IconInfoCircle } from '@fibrous/semi-icons-vue';
    import { Divider, Image, ImagePreview, Tooltip } from '@fibrous/semi-ui-vue';

    const srcList = ['/assets/root-web-sites/abstract.jpg', '/assets/root-web-sites/sky.jpg', '/assets/root-web-sites/greenleaf.jpg'];
</script>

<template>
    <ImagePreview>
        <template #previewMenu="{ menuItems }">
            <div
                :style="{
                    display: 'flex',
                    backgroundColor: 'rgba(0, 0, 0, 0.75)',
                    alignItems: 'center',
                    padding: '5px 16px',
                    borderRadius: '4px',
                }"
            >
                <component :is="item" v-for="(item, index) in menuItems.slice(0, 3)" :key="`a${index}`" />
                <Divider layout="vertical" />
                <component :is="item" v-for="(item, index) in menuItems.slice(3, 7)" :key="`b${index}`" />
                <Divider layout="vertical" />
                <component :is="item" v-for="(item, index) in menuItems.slice(7)" :key="`c${index}`" />
                <Divider layout="vertical" />
                <Tooltip content="我是一个自定义操作">
                    <IconInfoCircle size="large" />
                </Tooltip>
            </div>
        </template>
        <Image v-for="(src, index) in srcList" :key="src" :alt="`lamp${index + 1}`" :src="src" :width="200" />
    </ImagePreview>
</template>

Customize the preview top display area

The #title="{ title, index }" slot replaces the content of the title section at the top of the preview. When there is a title, the preview dialog is named by that section through aria-labelledby, so its name is the text the slot renders; without a title the name is "Preview" from the locale. Use #closeIcon to replace the close icon, and #leftIcon="{ index }" and #rightIcon="{ index }" to replace the arrow icons

lamp1
lamp2
Code
<script setup lang="ts">
    import { Image, ImagePreview } from '@fibrous/semi-ui-vue';

    const srcList = ['/assets/root-web-sites/abstract.jpg', '/assets/root-web-sites/sky.jpg'];
</script>

<template>
    <ImagePreview>
        <template #title="{ title }">
            <div
                :style="{
                    width: '100%',
                    height: '100%',
                    display: 'flex',
                    alignItems: 'center',
                    justifyContent: 'center',
                }"
            >
                <span :style="{ background: 'black', padding: '0 10px' }">自定义标题:{{ title }}</span>
            </div>
        </template>
        <div>
            <Image v-for="(src, index) in srcList" :key="src" :alt="`lamp${index + 1}`" :preview="{ previewTitle: `lamp${index + 1}` }" :src="src" :style="{ marginRight: '5px' }" :width="200" />
        </div>
    </ImagePreview>
</template>

API reference

Image

Props

PropertyDescriptionTypeDefault
srcImage source URL.stringsemiGlobalDefault("Image", "src")
widthDisplay width of the image; a number is in px.string | numbersemiGlobalDefault("Image", "width")
heightDisplay height of the image; a number is in px.string | numbersemiGlobalDefault("Image", "height")
altImage description, also the accessible name of a previewable thumbnail.stringsemiGlobalDefault("Image", "alt")
crossOriginThe crossorigin attribute passed to the native img element."anonymous" | "use-credentials"semiGlobalDefault("Image", "crossOrigin")
fallbackFallback image URL shown when loading fails; use the fallback slot for custom content, which takes precedence.stringsemiGlobalDefault("Image", "fallback")
previewPreview options; false disables preview. The object carries data and callbacks only; use Image slots for custom content.boolean | ImagePreviewPropssemiDefault("Image", "preview", true)
imgStyleCustom style passed to the img element.StyleValuesemiGlobalDefault("Image", "imgStyle")
imgClsCustom class name passed to the img element.stringsemiGlobalDefault("Image", "imgCls")
setDownloadNameSets the download file name of the image.Type((src: string) => string)undefined

Events

EventDescriptionCallback parameters
loadEmitted when the image has loaded.[event: Event]
errorEmitted when the image fails to load.[event: Event]

Slots

SlotDescriptionScope parameters
placeholderPlaceholder content shown until the image has loaded.any
fallbackCustom content shown when loading fails; it takes precedence over the fallback prop.any
titleReplaces the content of the title section at the top of the preview; when there is a title, the dialog is named by the text the slot renders. It applies to this Image's own preview only and has no effect inside an ImagePreview.ImagePreviewTitleSlotProps
previewMenuCustom bottom menu of the preview. It applies to this Image's own preview only and has no effect inside an ImagePreview.MenuProps
leftIconCustom previous icon. It applies to this Image's own preview only and has no effect inside an ImagePreview.ImagePreviewIconSlotProps
rightIconCustom next icon. It applies to this Image's own preview only and has no effect inside an ImagePreview.ImagePreviewIconSlotProps
closeIconCustom close icon. It applies to this Image's own preview only and has no effect inside an ImagePreview.any

Exposes

NameDescriptionType
None

A number for width or height is in px. class and style land on the root element; other undeclared native attributes and listeners land on the inner img. The preview object accepts the props and callbacks of ImagePreview (onVisibleChange, onChange, onClose, onZoomIn, onZoomOut, onPrev, onNext, onRatioChange, onRotateLeft, onDownload, onDownloadError), except lazyLoad, lazyLoadMargin, class and style (use previewCls and previewStyle to style the preview). Custom nodes do not go in preview; use the slots of Image. When preview.src is an array, switching images returns to "fit to page". An Image inside an ImagePreview ignores #title, #previewMenu, #leftIcon, #rightIcon and #closeIcon; the slots of the ImagePreview apply.

ImagePreview

Props

PropertyDescriptionTypeDefault
srcImage URLs to preview. When wrapping Image components, it is merged with the preview images they register, with the src entries first.string | string[]semiDefault("ImagePreview", "src", [])
visibleControlled visibility of the preview.booleansemiGlobalDefault("ImagePreview", "visible")
defaultVisibleWhether the preview is open initially.booleansemiGlobalDefault("ImagePreview", "defaultVisible")
currentIndexControlled index of the current image.numbersemiGlobalDefault("ImagePreview", "currentIndex")
defaultCurrentIndexIndex of the image shown initially.numbersemiGlobalDefault("ImagePreview", "defaultCurrentIndex")
previewTitleTitle at the top of the preview and the accessible name of the dialog; preview.previewTitle of a grouped image takes precedence.stringsemiGlobalDefault("ImagePreview", "previewTitle")
lazyLoadWhether to lazy-load the images of the group.booleansemiDefault("ImagePreview", "lazyLoad", true)
lazyLoadMarginThe rootMargin of the lazy-load observer, relative to the viewport; scrolling ancestors still clip.stringsemiDefault("ImagePreview", "lazyLoadMargin", "0px 100px 100px 0px")
maskClosableWhether clicking the mask closes the preview.booleanTypesemiDefault("ImagePreview", "maskClosable", previewDefaults.maskClosable)
closableWhether to show the close button.booleansemiDefault("ImagePreview", "closable", previewDefaults.closable)
closeOnEscWhether Esc closes the preview.booleansemiDefault("ImagePreview", "closeOnEsc", previewDefaults.closeOnEsc)
infiniteWhether switching loops around.booleansemiDefault("ImagePreview", "infinite", previewDefaults.infinite)
showTooltipWhether to show tooltips on the bottom controls.booleanTypesemiDefault("ImagePreview", "showTooltip", previewDefaults.showTooltip)
preLoadWhether to preload neighboring images.booleansemiDefault("ImagePreview", "preLoad", previewDefaults.preLoad)
preLoadGapHow many images ahead and behind to preload.numbersemiDefault("ImagePreview", "preLoadGap", previewDefaults.preLoadGap)
viewerVisibleDelayIdle time in milliseconds before the preview controls hide.numberTypesemiDefault("ImagePreview", "viewerVisibleDelay", previewDefaults.viewerVisibleDelay)
zoomStepZoom change per step.numbersemiDefault("ImagePreview", "zoomStep", previewDefaults.zoomStep)
maxZoomMaximum zoom factor.numbersemiDefault("ImagePreview", "maxZoom", previewDefaults.maxZoom)
minZoomMinimum zoom factor.numbersemiDefault("ImagePreview", "minZoom", previewDefaults.minZoom)
zIndexz-index of the preview layer.numbersemiDefault("ImagePreview", "zIndex", previewDefaults.zIndex)
disableDownloadWhether to disable download.booleanTypesemiDefault("ImagePreview", "disableDownload", previewDefaults.disableDownload)
initialZoomInitial zoom factor of an image, applied once when it first opens or is switched to, clamped by minZoom and maxZoom.numbersemiGlobalDefault("ImagePreview", "initialZoom")
crossOriginThe crossorigin attribute passed to the preview img element."anonymous" | "use-credentials"semiGlobalDefault("ImagePreview", "crossOrigin")
previewClsCustom class name of the preview.stringsemiGlobalDefault("ImagePreview", "previewCls")
previewStyleCustom style of the preview.StyleValuesemiGlobalDefault("ImagePreview", "previewStyle")
prevTipTip of the previous button.stringsemiGlobalDefault("ImagePreview", "prevTip")
nextTipTip of the next button.stringsemiGlobalDefault("ImagePreview", "nextTip")
zoomInTipTip of the zoom-in button.stringsemiGlobalDefault("ImagePreview", "zoomInTip")
zoomOutTipTip of the zoom-out button.stringsemiGlobalDefault("ImagePreview", "zoomOutTip")
rotateTipTip of the rotate button.stringsemiGlobalDefault("ImagePreview", "rotateTip")
downloadTipTip of the download button.stringsemiGlobalDefault("ImagePreview", "downloadTip")
adaptiveTipTip of the fit-to-page button.stringsemiGlobalDefault("ImagePreview", "adaptiveTip")
originTipTip of the original-size button.stringsemiGlobalDefault("ImagePreview", "originTip")
getPopupContainerParent DOM the preview renders into. A container other than document.body makes the preview non-modal; a custom container needs position: relative.Type(() => HTMLElement)undefined
setDownloadNameSets the download file name of an image.Type((src: string) => string)undefined

Events

EventDescriptionCallback parameters
update:visibleEmitted when visibility changes, for v-model:visible.[visible: boolean]
visibleChangeEmitted when visibility changes.[visible: boolean]
update:currentIndexEmitted when the current index changes, for v-model:currentIndex.[index: number]
changeEmitted when the image switches.[index: number]
closeEmitted when closed with the close button or Esc; closing by the mask triggers visibleChange only.[]
zoomInEmitted when the image zooms in.[zoom: number]
zoomOutEmitted when the image zooms out.[zoom: number]
prevEmitted when switching to the previous image.[index: number]
nextEmitted when switching to the next image.[index: number]
ratioChangeEmitted when switching between original size and fit-to-page.[type: RatioType]
rotateLeftEmitted when the image rotates counterclockwise.[angle: number]
downloadEmitted when an image is downloaded.[src: string, index: number]
downloadErrorEmitted when a download fails.[src: string]

Slots

SlotDescriptionScope parameters
defaultThe Image components to preview.any
titleReplaces the content of the title section at the top of the preview. When there is a title, the dialog is named by that section through aria-labelledby, so its name is the text the slot renders; without a title the name comes from the locale.ImagePreviewTitleSlotProps
previewMenuCustom bottom menu, receiving MenuProps; menuItems is the array of default item VNodes.MenuProps
leftIconCustom previous icon.ImagePreviewIconSlotProps
rightIconCustom next icon.ImagePreviewIconSlotProps
closeIconCustom close icon.any

Exposes

NameDescriptionType
None

class, style and native attributes land on the root element (the group div) through attrs; with aria-label or aria-labelledby and no role, the root gets role="group". The preview dialog is rendered into getPopupContainer (document.body by default) and is named by previewTitle, or by the locale when there is no title.

min, max, step and zoom are percentages (a min of 10 means 10%, a step of 10 means 10% per step), unlike minZoom, maxZoom, zoomStep and initialZoom of ImagePreview, which are factors (such as 0.1 and 5).

PropertiesInstructionsType
curPageCurrent image page subscriptnumber
disabledPrevWhether to disable the left toggle buttonboolean
disabledNextWhether to disable the right toggle buttonboolean
disabledZoomInWhether the zoom is at its maximum (the zoom-in button is disabled)boolean
disabledZoomOutWhether the zoom is at its minimum (the zoom-out button is disabled)boolean
disableDownloadWhether to disable the download buttonboolean
maxThe maximum zoom of the image (percentage)number
minThe minimum zoom of the image (percentage)number
onDownloadCall function when the image is downloaded() => void
onZoomInCall function when the image is zoomed in() => void
onZoomOutCall function when the image is zoomed out() => void
onRatioClickCall function to switch between the original size and fit to page() => void
onPrevCall function to switch the picture forward() => void
onNextCall function to switch the picture backward() => void
onRotateLeftCall function to rotate the image counterclockwise() => void
onRotateRightCall function to rotate the image clockwise() => void
ratioOriginal size or Fit to page button state"adaptation" | "realSize"
stepStep size of zooming (percentage)number
totalNumThe total number of images that can be previewednumber
zoomCurrent zoom of the image (percentage)number
menuItemsThe default bottom operation area items as a VNode array, which can be rendered as they areVNode[]

Accessibility

ARIA

  • When rendered into document.body (the default), the preview is a modal dialog with role="dialog" and aria-modal="true"; rendered into a custom container (getPopupContainer returns another element, including a container set on ConfigProvider) it is a non-modal dialog and does not output aria-modal. It is named by its title (previewTitle, or preview.previewTitle of an image in a group) when there is one, otherwise by "Preview" from the locale
  • Close, the left and right arrows, and the footer's previous, next, zoom out, zoom in, original size / adapt to the page, rotate and download controls are native button elements. Their accessible names come from the matching prevTip, nextTip and other tip props, or from the locale when those are not set. The zoom slider is named "Zoom" from the locale, with the current percentage as its aria-valuetext
  • At the first or last image, or at a zoom limit, the matching footer button gets aria-disabled="true" and stays focusable, so focus is not lost. The download button is also disabled when there is no current image (an empty src list)
  • The footer page counter has aria-live="polite", so screen readers announce the new position when the image changes
  • With the preview enabled and the image loaded, the root of an Image thumbnail is a focusable button (role="button", tabindex="0", aria-haspopup="dialog") named by the alt of the image; with preview set to false, or before the image has loaded, it is not focusable. Closing the preview returns focus to the thumbnail. A thumbnail inside an ImagePreview group that opens with the mouse also opens with the keyboard: while loading or after a load error it still has the button role and is focusable, and Enter or Space opens the group preview
  • The alt of the preview image is the alt of the thumbnail it shows (an ImagePreview src array has no alt, so it is an empty string)

Keyboard interaction

  • With focus on a thumbnail, Enter or Space opens the preview
  • Opening the preview moves focus into it. In a modal preview, Tab and Shift + Tab cycle through its controls and closing it returns focus to the element focused before; a non-modal preview rendered into a custom container does not trap Tab, and on close focus returns to the element focused before only if it is still inside the preview or on body, and stays where it is when it has moved elsewhere on the page
  • Enter or Space presses the focused button
  • ← and → switch to the previous and next image, swapped in RTL (ConfigProvider direction="rtl"). At the first or last image they behave like the buttons: they wrap around when infinite is true and do nothing otherwise
  • ← and → do not switch images while focus is in an input, textarea, select or editable element (such as an input in a custom footer), or while Alt, Ctrl, Meta or Shift is held; on the focused zoom slider they change the zoom
  • Esc closes the preview (unless closeOnEsc is false)
  • After the controls hide because of viewerVisibleDelay, a key press or focus on a control shows them again; they stay shown while focus is on one of them

Design Token

These are the component's internal Sass variables and cannot be overridden. To customize styles, override the --semi-* CSS variables (see the Design Token page) or write unlayered CSS rules.
Sass variableValueUsage
$transform_rotate-image_preview_spinnervar(--semi-transform_rotate-clockwise360deg)预览图像加载spin旋转角度
$transform_scale3d-image_preview_image_img1, 1, 1预览图片放大
$transform_rotate-image_preview_image_imgvar(--semi-transform_rotate-none)预览图片旋转角度
$transition_duration-image_preview500ms预览图片透明度变化动画时间
$transform_rotate-image_preview_icon_rtlvar(--semi-transform_rotate-clockwise180deg)rtl模式下向前/向后切换图片按钮旋转角度
$spacing-image_preview_icon-x24px图像预览中部左右调节icon与页面距离
$spacing-image_preview_header-paddingY0图像预览header部分上下内边距
$spacing-image_preview_header-paddingX24px图像预览header部分左右内边距
$spacing-image_preview_footer-paddingY0图像预览footer操作区部分上下内边距
$spacing-image_preview_footer-paddingX16px图像预览footer操作区部分左右内边距
$spacing-image_preview_footer_page-marginY0图像预览footer操作区图像页数据上下内边距
$spacing-image_preview_footer_page-marginX12px图像预览footer操作区图像页数据左右内边距
$spacing-image_preview_footer_slider-paddingY0图像预览footer操作区slider上下内边距
$spacing-image_preview_footer_slider-paddingX16px图像预览footer操作区slider左右内边距
$spacing-image_preview_footer_slider_handle-marginTop8px图像预览footer操作区slider的滑块上外边距
$spacing-image_preview_footer_divider-marginY0图像预览footer操作区slider的分割线上下外边距
$spacing-image_preview_footer_divider-marginX16px图像预览footer操作区slider的分割线左右外边距
$spacing-image_preview_footer_gap-marginLeft16px图像预览footer操作区icon的左外边距
$width-image_preview_footer_slider132px图像预览footer操作区slider宽度
$width-image_preview_footer_slider_handle16px图像预览footer操作区滑块宽度
$width-image_preview_icon40px图像预览footer操作区icon宽度
$width-image_preview_header_close30px图像预览header部分的关闭热区宽度
$height-image_preview_header60px图像预览header部分高度
$height-image_preview_footer48px图像预览footer部分高度
$height-image_preview_footer_slider2px图像预览footer中slider高度
$height-image_preview_footer_slider_handle16px图像预览footer中slider的滑块高度
$height-image_preview_icon40px图像预览footer操作区icon高度
$height-image_preview_header_close30px图像预览header部分的关闭热区高度
$radius-imagevar(--semi-border-radius-small)图像圆角
$radius-image_preview_footervar(--semi-border-radius-medium)图像预览footer操作区圆角
$color-image_status-bgvar(--semi-color-fill-0)图像加载失败背景颜色
$color-image_statusvar(--semi-color-disabled-text)图像状态加载失败 icon 颜色
$color-image_preview_iconvar(--semi-color-white)图像预览中部左右icon背景色
$color-image_preview_headervar(--semi-color-white)图像预览header文字颜色
$color-image_preview_footer_iconvar(--semi-color-white)图像预览footer中icon颜色
$color-image_preview_footer_slider_railvar(--semi-color-white)图像预览footer中slider滑轨颜色
$color-image_preview_disabledrgba(249, 249, 249, 0.35)图像预览禁用颜色
$color-image_preview_icon-bgrgba(0, 0, 0, 0.75)图像预览中部icon背景色
$color-image_header_close-bgrgba(0, 0, 0, 0.75)图像预览header的关闭icon的hover背景色
$color-image_preview_footer-bgrgba(0, 0, 0, 0.75)图像预览footer部分背景色
$color-image-preview_divider-bgrgba(255, 255, 255, 0.5)图像预览footer中的分割线背景色
$color-image_preview_image_spin#ccc图像预览的加载状态颜色