object
Display structured key-value data in a clean, readable format.
Usage

return block.object({
title: 'User Details',
data: {
name: 'Alice',
email: 'alice@example.com',
role: 'Admin',
lastLogin: '2024-01-15',
},
})Props
| Prop | Description | Type | Required | Default |
|---|---|---|---|---|
| title | Title displayed above the object | string | No | undefined |
| description | Description text below the title | string | No | undefined |
| data | Object containing key-value pairs to display | Record<string, unknown> | Yes | — |
Returns
Returns an object block that can be returned from a handler or passed to io.message().
Examples
Basic object display

return block.object({
title: 'Configuration',
data: {
environment: 'production',
region: 'us-east-1',
version: '2.4.0',
debug: false,
},
})API response details

const response = await fetchUserDetails(userId)
return block.object({
title: 'User Profile',
description: `ID: ${userId}`,
data: {
name: response.name,
email: response.email,
role: response.role,
createdAt: response.createdAt,
status: response.status,
},
})Error details

return block.object({
title: 'Error Details',
description: 'An error occurred while processing the request',
data: {
code: 'ERR_VALIDATION',
message: 'Invalid email format',
field: 'email',
timestamp: new Date().toISOString(),
},
})Order summary

return block.object({
title: 'Order Summary',
data: {
orderId: 'ORD-2024-001',
customer: 'John Doe',
items: 5,
subtotal: '$120.00',
tax: '$12.00',
total: '$132.00',
status: 'Processing',
},
})Combine with layout

return block.layout({
columns: 12,
children: [
{
element: block.object({
title: 'Billing Address',
data: billingAddress,
}),
colSpan: 6,
},
{
element: block.object({
title: 'Shipping Address',
data: shippingAddress,
}),
colSpan: 6,
},
],
})