Skip to content

Commit 1e32c88

Browse files
wobbaVesaJuvonen
authored andcommitted
Added docs on how to hide a webpart from the modern toolbox (SharePoint#1889)
1 parent ed92fd8 commit 1e32c88

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Hide a web part from the toolbox
3+
description: How to hide a web part from showing up in the web part toolbox on a modern page
4+
ms.date: 05/23/2018
5+
ms.prod: sharepoint
6+
---
7+
8+
# Hide a web parts from the toolbox
9+
10+
For scenarios where you automatically instantiate a custom web part on a modern page, you might want the web part not to be manually available for end-users. This could for example be a status web part on a home page.
11+
12+
## Configure hiding the web part from the toolbox
13+
14+
By default a SharePoint Framework client-side web part will be displayed in the web part toolbox when a user edit a page. To allow hiding the web part from the toolbox you add set the `hiddenFromToolbox` property to `true` in the web part manifest.
15+
16+
```json
17+
{
18+
"$schema": "https://dev.office.com/json-schemas/spfx/client-side-web-part-manifest.schema.json",
19+
"id": "34f6d7f2-262f-460a-8b65-152d784127cb",
20+
"alias": "HelloWorldWebPart",
21+
"componentType": "WebPart",
22+
23+
// The "*" signifies that the version should be taken from the package.json
24+
"version": "*",
25+
"manifestVersion": 2,
26+
27+
// If true, the component can only be installed on sites where Custom Script is allowed.
28+
// Components that allow authors to embed arbitrary script code should set this to true.
29+
// https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f
30+
"requiresCustomScript": false,
31+
"hiddenFromToolbox": true,
32+
33+
"preconfiguredEntries": [{
34+
"groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other
35+
"group": { "default": "Other" },
36+
"title": { "default": "HelloWorld" },
37+
"description": { "default": "HelloWorld description" },
38+
"officeFabricIconFontName": "Page",
39+
"properties": {
40+
"description": "HelloWorld"
41+
}
42+
}]
43+
}
44+
```
45+
46+
With the `hiddenFromToolbox` setting enabled, when you edit a page, the web part will not be listed in the toolbox.

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
href: spfx/web-parts/basics/configure-web-part-icon.md
4343
- name: Using full-width column
4444
href: spfx/web-parts/basics/use-web-parts-full-width-column.md
45+
- name: Hide from the toolbox
46+
href: spfx/web-parts/basics/hide-web-part-from-toolbox.md
4547
- name: Preconfigure web parts
4648
href: spfx/web-parts/guidance/simplify-adding-web-parts-with-preconfigured-entries.md
4749
- name: Validate properties

0 commit comments

Comments
 (0)