page Imagecomponent { seo { title = "Image component" description = "Theme-aware, responsive image component." } view {
W WRNexusJS
layout component

Image

Theme-aware, responsive image component.

@wrnexus/ui 0.3.69 props1 slots0 events

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

PropTypeRequirementDefault
sizestringOptional"default"
colorstringOptional"primary"
srcstringOptional""
altstringOptional""
widthstringOptional""
heightstringOptional""
loadingstringOptional"lazy"
roundedbooleanOptionalfalse
classstringOptional""

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>
    }
}
} }