Anatomy
- Container: Holds the image
Usage
Use the image component to place static images in your page.
Configurations
Learn how to customize image by configuring the available properties.
Plugin
To use this component, you must activate the com.servicenow_now_image plugin on your ServiceNow instance.
Presets and controllers
This component can contain preset configuration values. Presets automatically configure properties and event handlers for a component, making the component ready to work when you add it to a page. Presets are designed to suit a specific use case. However, you can override a preset with a custom configuration if you find it necessary for your design. Any preset values that you override aren’t upgraded when updates are available. If you don’t want to use the preset provided, select the option to configure the component manually. For more information, see Presets.
A preset connects to a controller, which acts as a data resource for the component. Controllers provide the configuration data and event binding the component needs to function in your experience. For more information, see Controllers.
You can apply one preset to a single instance of a component on a page. In the Tokyo release, there are 2 controllers available: the UI page controller and the Record controller. The Record controller retrieves metadata and configurations for the page definition. The UI page controller retrieves data related to the page behavior, such as component preference states and cross-component behaviors.
Select the image
Provide the URL to the image. Any file type using the element that is supported by web browsers is acceptable. Newer formats such as WebP and AVIF have better performance than the older PNG, JPEG, and GIF file formats.
Fit the image
Configure how you want the image to fit into it’s container. This is necessary when the height and width of the container differ from the image's dimensions. Be aware that your choice could affect the proportions of your image unless you fit it to scale.
Positioning the image
You can position the image in the center of the container (default) or align it to any of the corners.
Design recommendations
- Display images at their intended aspect ratio to avoid distortion
- Size the image to fit the desired display. The image should not appear blurry or pixelated
- Be sensitive to load times, keep resolutions minimal when possible
- Provide alternative text or a caption to ensure accessibility
- Use context-relevant images
- Provide a focal point and avoid images that require the user to search for the meaning
Usability
Image complies with all internationalization and accessibility requirements.
Accessibility
Learn how to access the actionable elements of image through screen readers.
Keyboard interactions
Arrow up, Arrow down, Arrow left, Arrow right: Used to access and read the ALT text attached to the image when the screen reader is in browse/read mode.
Note: Because the image component has no actionable elements in it, the tab key can’t select the component.
Screen readers
Screen readers can access the image component using browse/read mode.