src (attribute) |
URL of the image to display. |
<view-image src="imgs/photo.jpg"></view-image>
|
alt (attribute) |
Alt text for the internal <img> element. |
<view-image src="imgs/chart.png" alt="Q3 chart"></view-image>
|
width (attribute) |
Initial width of the view box (any CSS length: px, rem, %). Overridden by click-to-resize after the first click. |
<view-image src="imgs/map.png" width="480px"></view-image>
|
bg-color (attribute) |
Background color of the view box. Accepts any CSS color value or custom property. |
<view-image src="imgs/x.png" bg-color="var(--light)"></view-image>
|
title-bg-color (attribute) |
Background color for the title/caption bar. |
<view-image src="imgs/x.png" title-bg-color="#ccc"></view-image>
|
step-px (attribute) |
Pixels added or removed per click. Default: 40. |
<view-image src="imgs/x.png" step-px="60"></view-image>
|
min-width (attribute) |
Minimum view width in pixels when shrinking. Default: 120. |
<view-image src="imgs/x.png" min-width="200"></view-image>
|
Slot: (default) |
Caption text rendered in the title bar above the image. |
<view-image src="imgs/x.png">
Figure 1. Floor Plan
</view-image>
|
| Click image (behavior) |
Widens the view by step-px per click, measured from the width at first click. |
// user clicks image panel → width grows by step-px
|
| Click title (behavior) |
Narrows the view by step-px per click, clamped to min-width. |
// user clicks title bar → width shrinks by step-px
|
CSS parts: view, title |
Exposed via part attribute for external styling with ::part(). |
view-image::part(title) {
font-style: italic;
}
|
| Events |
No custom events are dispatched. Width changes happen internally via inline style. |
// no custom events in current build
|