An image that can be be enlarged to view in full detail using the Lightbox.
<tk-expandable-image
image-uri="/images/expandable-image/kitten-tiny.png"
description="kitten-tiny.png"
image-alt="Picture of a kitten"
focus-text="Expand image"
> </tk-expandable-image>
<hr class="horizontal-rule">
<tk-expandable-image
image-uri="/images/expandable-image/kitten-portrait.png"
description="kitten-portrait.png"
image-alt="Picture of a kitten"
focus-text="Expand image"
> </tk-expandable-image>
<hr class="horizontal-rule">
<tk-expandable-image
image-uri="/images/expandable-image/kitten-smaller.png"
description="Sample-Image.png"
image-alt="Picture of a kitten"
focus-text="Expand image"
> </tk-expandable-image>
<hr class="horizontal-rule">
<tk-expandable-image
image-uri="/images/expandable-image/kitten.png"
description="Sample-Image.png"
image-alt="Picture of a kitten"
focus-text="Expand image"
> </tk-expandable-image>
>
Provide the
image-alt
attribute to enable screen readers to read information about the image.
<tk-expandable-image
image-uri="/images/expandable-image/kitten.png"
description="Sample-Image.png"
image-alt="Picture of a kitten"
focus-text="Expand image"
> <tk-expandable-image-controls>
<tk-expandable-image-control>
<tk-icon-button type="outline" label="Expand image">
<tk-icon name="move"></tk-icon>
</tk-icon-button>
<tk-tooltip position="left">Expand image</tk-tooltip>
</tk-expandable-image-control>
<tk-expandable-image-control>
<tk-icon-button type="outline" label="Delete this file">
<tk-icon name="delete"></tk-icon>
</tk-icon-button>
<tk-tooltip position="left">Delete this file</tk-tooltip>
</tk-expandable-image-control>
</tk-expandable-image-controls>
</tk-expandable-image>
<hr class="horizontal-rule">
<tk-expandable-image
image-uri="/images/expandable-image/kitten.png"
description="Sample-Image.png"
image-alt="Picture of a kitten"
focus-text="Expand image"
> <tk-expandable-image-controls>
<tk-expandable-image-control>
<tk-icon-button type="outline" label="Expand image">
<tk-icon name="move"></tk-icon>
</tk-icon-button>
<tk-tooltip position="left">Expand image</tk-tooltip>
</tk-expandable-image-control>
<tk-expandable-image-control>
<tk-icon-button type="outline" status="disabled" label="Delete this file">
<tk-icon name="delete"></tk-icon>
</tk-icon-button>
</tk-expandable-image-control>
</tk-expandable-image-controls>
</tk-expandable-image>
A tk-expandable-image-control
consists of an icon button and a tooltip. Make sure to render a label on the button. Sse the status
attribute on tk-icon-button
to render a button as disabled.
<tk-expandable-image
image-uri="/images/expandable-image/kitten.png"
description="Sample-Image.png"
image-alt="Picture of a kitten"
focus-text="Expand image"
max-width="600"
> </tk-expandable-image>
>
Use this prop to render the image wider than the default
max-width
of462px
. Height will scale according to the ratio established in the image.
<!-- for demo only -->
<tk-highlight
style="display: block;"
id="tkHighlight"
> </tk-highlight>
<tk-expandable-image
id="exampleExpandableImage"
image-uri="/images/expandable-image/kitten.png"
description="Sample-Image.png"
image-alt="Picture of a kitten"
focus-text="Expand image"
> <tk-expandable-image-controls>
<tk-expandable-image-control>
<tk-icon-button type="outline" label="Expand image">
<tk-icon name="move"></tk-icon>
</tk-icon-button>
<tk-tooltip position="left">Expand image</tk-tooltip>
</tk-expandable-image-control>
<tk-expandable-image-control>
<tk-icon-button type="outline" label="Delete this file">
<tk-icon name="delete"></tk-icon>
</tk-icon-button>
<tk-tooltip position="left">Delete this file</tk-tooltip>
</tk-expandable-image-control>
</tk-expandable-image-controls>
</tk-expandable-image>
This is a vanilla JS example. When using a framework like Angular or React you would code the respective equivalent.
<tk-expandable-image
image-uri="/images/expandable-image/kitten.png"
description="Sample-Image.png"
image-alt="Picture of a kitten"
focus-text="Expand image"
read-only
> </tk-expandable-image>
>
To disable interaction with the component, pass the
read-only
prop.