Skip to main content

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​

  1. Select an object type from the available options in the tool.
  2. Edit the template values to change how the object renders. Use {field_name} syntax to reference object fields.
  3. The preview updates in real time as you modify template values.

Common template properties​

Display templates typically include the following properties:

PropertyPurposeExample value
nameObject title shown in wallets{collection_name} #{number}
descriptionObject descriptionA collectible from the {collection_name} series
image_urlPreview image URLhttps://example.com/images/{image_id}.png
linkURL to the object's detail pagehttps://example.com/items/{id}
project_urlProject homepagehttps://example.com
creatorCreator name or addressExample 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, and link are dynamic. A dynamic value can combine fixed text with field references, as in https://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) and creator (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.