Skip to main content

io.display.metadata

Displays a series of label/value pairs in a variety of layout options.

Usage

await io.display.metadata("User info", {
layout: "card",
data: [
{
label: "Name",
value: `${user.firstName} ${user.lastName}`,
},
{
label: "Email",
value: user.email,
url: `mailto:${user.email}`,
},
{
label: "Friends",
value: user.friends.length,
},
],
});
interval.com

Props

data

object[] Required

Array of label/value objects, with optional markup data.
{
// the item label
label?: string;
// the item display text value
value?: string | number | boolean | Date;
// links the item to an external URL
url?: string;
// links the item to another action
action?: string;
// arbitrary key/value pairs to send to the linked action
props?: Record<string, any>;
// a visible image to be displayed in the cell
// must contain either `url` or `buffer`
image?: {
// a URL to the image
url?: string
// a buffer containing the image contents
buffer?: Buffer
// the image alt tag
alt?: string
// the size of the image
size?: "thumbnail" | "small" | "medium" | "large"
}
}[]

layout

'card' | 'list' | 'grid' Optional

Layout to display the metadata items, defaults to "grid"

Returns

null

Was this section useful?
On this page