Optional
childrenOptional
ononClick 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);
});
Optional
styleCSS 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.
Optional
tooltipTooltip 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 of the template fragment.
Sub-fragments of the container.
You can use container template fragment to create nested composition structures.