Object Display Templates
Object Display templates define how your Sui objects appear in wallets, explorers, and other clients. Each template maps a display property (for example, name, description, image_url) to a format string that references fields on your object using {field_name} syntax.
The interactive tool below lets you experiment with Object Display V2 templates. You can modify template values and see how different field references and formatting options affect the rendered output.
How to use the preview tool
- Select an object type from the available options in the tool.
- Edit the template values to change how the object renders. Use
{field_name}syntax to reference object fields. - The preview updates in real time as you modify template values.
Common template properties
Display templates typically include the following properties:
| Property | Purpose | Example value |
|---|---|---|
name | Object title shown in wallets | {collection_name} #{number} |
description | Object description | A collectible from the {collection_name} series |
image_url | Preview image URL | https://example.com/images/{image_id}.png |
link | URL to the object's detail page | https://example.com/items/{id} |
project_url | Project homepage | https://example.com |
creator | Creator name or address | Example Studio |
Field references and static values
Each {field_name} reference in a template is replaced with the value of that field on the object being displayed. For example, for a hypothetical object whose collection_name field is Example and whose number field is 42, the name template {collection_name} #{number} renders as Example #42, and the description template renders as A collectible from the Example series.
Template values in the table above fall into two groups:
- Dynamic values contain one or more field references, so the rendered output differs from object to object. In the table,
name,description,image_url, andlinkare dynamic. A dynamic value can combine fixed text with field references, as inhttps://example.com/images/{image_id}.png. - Static values contain no field references, so every object shows the same text. In the table,
project_url(https://example.com) andcreator(Example Studio) are static.
Apply your template
To use a template you tried in the preview tool on your own objects, create a display for your object type programmatically. For the full reference on creating and managing displays programmatically, see Using Object Display.
Try the preview tool
The interactive preview tool is embedded below. Follow the steps in How to use the preview tool to edit template values and see the rendered output.