UI
Image
Display images in your Preswald application
Image
The Image widget allows you to display images in your Preswald application. It’s a simple wrapper around the HTML <img>
element
that provides consistent styling and integration with the Preswald framework.
Properties
Property | Type | Required | Default | Description |
---|---|---|---|---|
src | string | Yes | - | The URL or path to the image |
alt | string | No | ” | Alternative text for the image |
className | string | No | ” | Additional CSS classes to apply to the image |
Basic Usage
Examples
Display a Local Image
Adding Custom Styling
Notes
- The image widget supports common image formats like PNG, JPG, GIF, and SVG
- Make sure the image source URL is accessible from your application
- For local images, ensure the path is relative to your application’s root directory
- The widget automatically applies responsive sizing while maintaining aspect ratio
Was this page helpful?