AboutSupportDeveloper GuideVersion 19.0.3

Hierarchy

Properties

children?: TemplateFragment[]

Sub-fragments of the container.

You can use container template fragment to create nested composition structures.

onClick?: CustomData

onClick object that is user defined.

If provided, notification-action event will be raised when clicking on the fragment.

Example:

{
"type": "actionableText",
"dataKey": "titlexyz",
"tooltipKey": "some_key",
"onClick": { // contents are user-defined
"task": "schedule-reminder",
"eventId": 142341,
"intervalMs": 5000
}
}

import { addEventListener, clear } from 'openfin-notifications';

addEventListener('notification-action', (event: NotificationActionEvent<MyAction>)) => {
if (event.result.task === 'schedule-reminder') {
scheduleReminder(event.result.eventId, Date.now() + event.result.intervalMs);
}
clear(event.notification.id);
});
style?: Record<string, string | number>

CSS style properties of the fragment.

All the available custom template fragments support all of the React's inline style properties (with camelCase keys)

Note: "position: fixed" is disallowed in the fragments.

tooltipKey?: string

Tooltip key of the template fragment.

The string tooltip associated with this fragment will be looked up in templateData map with this key.

Example:

const myTemplate = {
body: {
compositions: [{
minTemplateAPIVersion: '1',
layout: {
type: "actionableText",
dataKey: 'message',
tooltipKey: 'tooltipxyz',
},
}],
},
}

const notificationOption: TemplateCustom = {
//...
templateOptions: myTemplate,
templateData: {
message: 'view stock tracker',
tooltipxyz: 'My Custom Tooltip',
}
};
type: "container"

Type of the template fragment.