Skip to content

Commit 3b7e389

Browse files
[Excel] (contextual tab) Define icons in the unified manifest (#4842)
* Document unified manifest step * Update ms.date * Update ms.date
1 parent c88af6b commit 3b7e389

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

docs/design/contextual-tabs.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,72 @@ Adding custom contextual tabs requires your add-in to use the [shared runtime](.
5858

5959
## Specify the icons for your contextual tab
6060

61-
Before you can customize your contextual tab, you must first specify any icons that will appear on it with an [Image](/javascript/api/manifest/image) element in the [Resources](/javascript/api/manifest/resources) section of your add-in's manifest. Each icon must have at least three sizes: 16x16 px, 32x32 px, and 80x80 px.
61+
Before you can customize your contextual tab, you must first specify any icons that will appear on it in your add-in's manifest. Each icon must have at least three sizes: 16x16 px, 32x32 px, and 80x80 px. Select the tab for the type of manifest your add-in uses.
62+
63+
# [Unified manifest for Microsoft 365](#tab/jsonmanifest)
64+
65+
In the "extensions.ribbons.tabs.groups.icons" array, specify the icons for the group of contextual tab controls that will be displayed on the host's ribbon. For icons that will be used by the tab's buttons and menus, specify these in the "icons" property of the "extensions.ribbons.tabs.groups.controls" object.
66+
67+
Because the contextual tab will only be shown when a certain event occurs, you must also set the "extensions.ribbons.tabs.groups.controls.overriddenByRibbonApi" property to `true`.
68+
69+
The following is an example.
70+
71+
```json
72+
"ribbons": [
73+
{
74+
...
75+
"tabs": [
76+
"groups": [
77+
{
78+
"id": "contextualTab",
79+
...
80+
"icons": [
81+
{
82+
"size": 16,
83+
"url": "https://cdn.contoso.com/addins/datainsertion/Images/Group16x16.png"
84+
},
85+
{
86+
"size": 32,
87+
"url": "https://cdn.contoso.com/addins/datainsertion/Images/Group32x32.png"
88+
},
89+
{
90+
"size": 80,
91+
"url": "https://cdn.contoso.com/addins/datainsertion/Images/Group80x80.png"
92+
}
93+
],
94+
"controls": [
95+
{
96+
"id": "contextualButton",
97+
...
98+
"icons": [
99+
{
100+
"size": 16,
101+
"url": "https://cdn.contoso.com/addins/datainsertion/Images/WriteDataButton16x16.png"
102+
},
103+
{
104+
"size": 32,
105+
"url": "https://cdn.contoso.com/addins/datainsertion/Images/WriteDataButton16x16.png"
106+
},
107+
{
108+
"size": 80,
109+
"url": "https://cdn.contoso.com/addins/datainsertion/Images/WriteDataButton16x16.png"
110+
}
111+
],
112+
...
113+
"overriddenByRibbonApi": true
114+
},
115+
...
116+
]
117+
}
118+
]
119+
]
120+
}
121+
],
122+
```
123+
124+
# [Add-in only manifest](#tab/xmlmanifest)
125+
126+
Use the [Image](/javascript/api/manifest/image) element in the [Resources](/javascript/api/manifest/resources) section of your add-in's manifest to specify the icons for your contextual tab.
62127

63128
The following is an example.
64129

@@ -76,6 +141,8 @@ The following is an example.
76141
</Resources>
77142
```
78143

144+
---
145+
79146
> [!IMPORTANT]
80147
> When you move your add-in from development to production, remember to update the URLs in your manifest as needed (such as changing the domain from `localhost` to `contoso.com`).
81148

0 commit comments

Comments
 (0)