Skip to content

Commit 1f70631

Browse files
waldekmastykarzVesaJuvonen
authored andcommitted
Added guidance on adding support for the full-width column to web parts (SharePoint#1526)
1 parent 5815065 commit 1f70631

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
925 KB
Loading
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: Use web parts with the full-width column
3+
description: Build web parts that can be used in the full-width column
4+
ms.date: 03/23/2018
5+
ms.prod: sharepoint
6+
---
7+
8+
# Use web parts with the full-width column
9+
10+
Modern SharePoint pages support layouts that allow users to organize the information they present on their pages. Users can choose from a number of different layouts, such as two columns, three columns or one-third column. Modern pages in communication sites offer users an additional page layout named **Full-width column**. This layout spans the full width of the page without any horizontal margin or padding. SharePoint Framework web parts can be placed in any layout, but due to its extra requirements, web parts must explicitly enable support for the full-width column.
11+
12+
## Layout requirements for the full-width column
13+
14+
One thing that regular layouts in modern SharePoint pages share, is the maximum width. To guarantee the ease of readability and usability, the body of a modern page doesn't expand beyond a certain width. When building web parts that will be used in regular layouts, you would test your web parts width the known maximum and minimum width constrains to ensure that they are displayed properly.
15+
16+
When working with the full-width column layout, things become a bit more complicated, as that layout expands to the full width of the page. When displayed on an ultra-wide monitor, the full-width column could become even a few thousands pixels wide. This introduces additional testing requirements that you should take into account when building web parts that can be used in the full-width column.
17+
18+
## Enable support for the full-width column
19+
20+
By default SharePoint Framework client-side web parts cannot be placed in the full-width column layout. To allow users to add your web part to the full-width column, in the web part manifest, set the `supportsFullBleed` property to `true`.
21+
22+
```json
23+
{
24+
"$schema": "https://dev.office.com/json-schemas/spfx/client-side-web-part-manifest.schema.json",
25+
"id": "34f6d7f2-262f-460a-8b65-152d784127cb",
26+
"alias": "HelloWorldWebPart",
27+
"componentType": "WebPart",
28+
29+
// The "*" signifies that the version should be taken from the package.json
30+
"version": "*",
31+
"manifestVersion": 2,
32+
33+
// If true, the component can only be installed on sites where Custom Script is allowed.
34+
// Components that allow authors to embed arbitrary script code should set this to true.
35+
// https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f
36+
"requiresCustomScript": false,
37+
"supportsFullBleed": true,
38+
39+
"preconfiguredEntries": [{
40+
"groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other
41+
"group": { "default": "Other" },
42+
"title": { "default": "HelloWorld" },
43+
"description": { "default": "HelloWorld description" },
44+
"officeFabricIconFontName": "Page",
45+
"properties": {
46+
"description": "HelloWorld"
47+
}
48+
}]
49+
}
50+
```
51+
52+
With this setting enabled, when you edit a page with a full-width column layout, your web part will be displayed among web parts that can be added to the column.
53+
54+
![Custom SharePoint Framework client-side web part displayed among web parts that can be added to a full-width column layout](../../../images/fullwidthcolumn-webpart-add.png)
55+
56+
At this moment, the SharePoint Workbench doesn't support testing web parts in the full-width column layout. Instead, you would have to deploy your web part to a developer tenant, create a communication site and test your web part in there.

0 commit comments

Comments
 (0)