<sessions-image>
An image with an accessible description.
Preact & React
<Image>GroupActionsDrawn asImagePreview
Drawn by the same renderers Sessions uses for your extension, from the DOM example beside it, without its event handlers.
When to use it
Pass intrinsic width and height (or an aspect-ratio) so the host reserves space before the image loads.
In Preact and React, import the component of the same name from @sessions/apps/preact or @sessions/apps/react. Attributes become camelCase props, a boolean attribute is a boolean prop, and an event is an on prop that receives the event’s detail.
Attributes
Attribute
srcrequiredThe image URL.Prop
srcaltrequiredThe accessible description.Prop
altwidthIntrinsic width in pixels.Prop
widthheightIntrinsic height in pixels.Prop
heightaspect-ratioA forced aspect ratio, e.g.
1.5.Prop aspectRatiofitHow the image fills its box.
covercontainProp fitmutedbooleanGrayscale and dimmed — a logo for something not connected yet. Removing it animates the image back to full colour.Prop
mutedExample
import {Image} from '@sessions/apps/preact';
<Image
src="https://example.com/cover.jpg"
alt="Album cover"
width="600"
height="600"
/>In the same group
<sessions-button>A button, or a link styled as one when to is set.<sessions-banner>A callout with a heading and a body.<sessions-badge>A small status label.<sessions-embed>A Spotify, Apple Music or YouTube player in a sandboxed frame.<sessions-disclosure-group>Stacks sessions-disclosure rows with dividers between them.<sessions-disclosure>A row that expands to reveal its children.