Images & graphics
A picture says more than a thousand lines of code.
Visual presence
Images give your application depth and identity.
The Image component binds native <img> elements reactively into the DSL. It supports static sources as well as reactive properties for dynamic galleries or profile pictures.
Static image
Simple inclusion of an image with source and alt text.
This image is loaded statically. The Image component ensures that all attributes are set correctly.
Dynamic image source
The source can be bound to a property to swap images at runtime.
DSL syntax
Attribute assignments happen intuitively inside the block.
scala
image {
src = "path/to/image.jpg"
alt = "Description"
style { width = "100%" }
}
// Or reactively:
val myProperty = Property("...")
val myAlt = Property("Description")
image {
src = myProperty
alt = myAlt
}