Image
Theme-aware, responsive image component.
Usage
Components are auto-discovered. Use the component directly in any .wrn view:
<Image
size="default"
color="primary"
src="src"
alt="alt"
width="width"
/>Legacy mount name: data-component="Image".
Props and attributes
| Prop | Type | Requirement | Default |
|---|---|---|---|
size | string | Optional | "default" |
color | string | Optional | "primary" |
src | string | Optional | "" |
alt | string | Optional | "" |
width | string | Optional | "" |
height | string | Optional | "" |
loading | string | Optional | "lazy" |
rounded | boolean | Optional | false |
class | string | Optional | "" |
Slots
default
Events
This component does not declare a custom event.
Source contract
Installed source: components/Image.wrn
component Image {
props {
size = "default"
color = "primary"
src = ""
alt = ""
width = ""
height = ""
loading = "lazy"
rounded = false
class = ""
}
view {
<figure class="wire-next wire-next--color-{color} wire-next--size-{size} wire-next--image {rounded ? 'wire-next--rounded' : ''} {class}">
<img src="{src}" alt="{alt}" width="{width}" height="{height}" loading="{loading}" />
<slot />
</figure>
}
}