How to use SharePoint document library web part [Complete tutorial]

In this SharePoint Online tutorial, we will discuss on SharePoint Document Library web part. We will see how to add and use the document library web part in SharePoint Online.

We will also learn about Dynamic filtering in the SharePoint Document Library web part with a few examples based on a SharePoint Online environment.

We will cover:

  • How to add Document Library web part in SharePoint online
  • Modern SharePoint document library web part remove see all
  • SharePoint Online document library web part column width
  • SharePoint document library web part from another site
  • Dynamic Filtering in SharePoint modern Document Library web part
  • SharePoint Online document library web part breadcrumb
  • How to Set Document Library web part to Specific folder.
  • Document Library tree view web part in SharePoint online
  • SharePoint multiple document library web part
  • SharePoint document library web part 30 items
  • SharePoint Online document library web part navigation

In the same way, we can also use the document library web part in SharePoint 2019 or the SharePoint subscription edition.

SharePoint Document Library web part

  • The SharePoint Document library web part allows us to select a single document library inside a SharePoint site page.
  • Users with proper permissions can edit, view, and add files straight from the document library web part itself.
  • By default, it will choose the document library name as a title for the document library web part. If we want to change the title, we can edit the document library web part and change the title in the title area.
  • Users can able to view, filter, sort, and also pin a document library, by selecting the See all options users can view the document library.

Read How to use People web part in SharePoint Online

How to add Document Library web part in SharePoint online

Let us see how we can add the document library web part to the modern SharePoint Online site,

  • Open the SharePoint site to add document library web parts to the SharePoint modern site page.
  • Select Edit Page in the modern SharePoint site page.
  • Add a new Section layout by clicking on the + circled icon.
  • In the search box, enter the document library and select a document library web part.
Document Library web part in SharePoint online
Document Library web part in SharePoint online
  • After adding the Document Library Web Part, it automatically displays the document libraries that are available on the current SharePoint site as shown below:
Document Library web part in modern SharePoint
Document Library web part in modern SharePoint
  • Select a document library directly or from a drop-down, which you want to display on your SharePoint site page. Click on the Apply button.
SharePoint online add web part to document library
SharePoint online adds the web part to the document library
  • Under View, you can select the view from a drop-down as All Documents.
SharePoint modern add web part to document library
SharePoint modern adds the web part to the document library

Here, We can provide the particular folder name as well as the Size of the web part. I have given the Size as Autosize – fit to a number of items.

Apart from this, We can choose the below options:

  • Small – about 5 items
  • Medium – about 15 items
  • Large – about 30 items
how to add web part to document library in SharePoint modern
on how to add the web part to the document library in SharePoint modern
  • Select Republish to commit your changes.
See also  SharePoint list operations using rest api

This is how we can add and edit the document library web part in modern SharePoint.

Read Power Automate Create Document Library

Modern SharePoint document library web part remove see all

Let us see how to remove see all options in the SharePoint Online document library web part,

  • Edit the SharePoint site page and edit a document library web part section.
  • In the property pane of the document library web part at the right, Enable the Show “See all” toggle control.
  • Click Apply to commit the changes. Select Republish.
SharePoint online document library web part remove see all
SharePoint Online document library web part remove see all

Now you cannot see the “see all” option in a document library web part, which is removed.

Modern SharePoint document library web part remove see all
Modern SharePoint document library web part remove see all

This is how to remove see all options in the modern SharePoint document library web part.

Read How to hide document library in SharePoint Online

SharePoint Online document library web part column width

Let us see how to increase the document library web part column width in modern SharePoint,

We can increase the column width of the document library and display it in a document library web part of the SharePoint modern page, To achieve this, follow the below steps:

  • Select Site contents from the SharePoint page, and open the document library to be modified.
  • Expand the column width, using the mouse.
SharePoint document library web part column width
SharePoint document library web part column width
  • Select the Save View as an option to save the current view.
SharePoint online document library web part column width
SharePoint Online document library web part column width
  • Click the Save button.
SharePoint modern document library web part column width
SharePoint modern document library web part column width
  • Refresh the SharePoint online site page, and now we can see the SharePoint modern document library web part column width has been increased as shown below;
SharePoint modern document library web part column width example
SharePoint modern document library web part column width example

This is how to increase the SharePoint document library web part column width.

Read How to get documents from the document library in SharePoint using Rest API

SharePoint document library web part from another site

  • No, directly we cannot display the document library in a document library web part from another site on a modern SharePoint page.
  • But there is an alternative way that we can do it, using the “Highlighted Content” web part we can display files from another site.
  • We can specify how many documents to show in the Highlighted content web part. There is a number limit to display documents, we can show up to 500.
  • If there are no documents to display, we also have an option to hide the highlighted web part.
  • Sort options that are available are Most recent, Most viewed, Trending, and ascending or descending by a Managed property. 

Read Difference between SharePoint list and Document library

Dynamic Filtering in SharePoint modern Document Library web part

Let us see how to work with dynamic filter in document library web part modern SharePoint,

  • With dynamic filtering, you can filter one document based on a selection made in another web part.
  • Select and edit the Document web part to apply a dynamic filter.
  • In the property pane of the Document web part at the right, slide the toggle control to the On position under the Dynamic filtering option.
  • Choose the column that we want to filter from the SharePoint list in the Column field to filter the documents.
  • Under the List or Library containing filter value, select the document you added to your SharePoint site page.
  • Select the column that has the values you want to filter by under the Column containing the filter value.
Dynamic filtering in document library web part modern SharePoint
Dynamic filtering in document library web part modern SharePoint

In this SharePoint online dynamic filtering document library web part example, we can filter one document and display it in the file viewer web part based on a selection made in a document library web part.

  • Now, edit the SharePoint site page and Select a two-column section to add the Document library web part, as well as the file viewer web part.
Document library web part filter in modern SharePoint
Document library web part filter in modern SharePoint
  • Now we can select a document library to add it to the web part, we will also see how to join the file viewer to the Source document.
Document library web part filter in SharePoint online
Document library web part filter in SharePoint online
  • Now we can see the Documents added to the document web part as shown below: To Merge the source document with the file viewer web part follow the below steps:
  • Edit the File viewer web part section, Select an ellipses (…) in the property pane, then select Connect to the source option.
Document library web part filter in the modern SharePoint
Document library web part filter in the modern SharePoint
  • We select the Source list in the file viewer web part from a dropdown. You can view that This web part is connected to the selected list, here are the Documents (highlighted in Red).
  • Once connected the Document library web part and file viewer web part look as shown below:
Document library web part filter in the SharePoint online
Document library web part filter in the SharePoint online
  • Select Republish to commit your changes.
See also  How to get file modification time and date using PowerShell

See the Output below:

  • When we select any documents from the SharePoint document library web part, it displays the selected document in the file viewer web part.
  • We can also see the selected SharePoint documents items in a document library web part breadcrumbs, as shown below:
Document library web part filter in modern SharePoint example
Document library web part filter in modern SharePoint example

This is how to work with dynamic filter in a document library web part modern SharePoint.

Read How to sort folders in the SharePoint document library

SharePoint Online document library web part breadcrumb

Yes, it is possible to display the document library web part breadcrumb on the modern SharePoint published page.

  • When we select any documents from the SharePoint documents library in a document library web part.
  • We can use breadcrumbs to navigate back to the SharePoint document library web part.
  • The selected SharePoint documents items from the document library web part will be shown in a document library web part breadcrumbs, as shown below:
SharePoint document library web part breadcrumb
SharePoint document library web part breadcrumb

This is how we can display the SharePoint document library web part breadcrumb.

Read SharePoint Online image column

How to Set Document Library web part to Specific folder

Let us see how we can set or open the Document Library web part to a specific folder in modern SharePoint.

  • In the modern SharePoint Document Library web part, it is possible to display the folder as well as the subfolder.
  • To display the nested folders in a document library web part, we have to type the path separated by ‘/’.

Follow the below steps to set the Document Library web part to a specific folder:

  • Edit the Document Library web part, in the property pane of the Document web part at the right you can see the Folder option.
  • Under the Folder option, we can specify the particular folder name that we want to display in the SharePoint document web part.
  • Select Apply and Republish the page to save your changes.
set Document Library web part to a specific folder
set Document Library web part to a specific folder

In the below screenshot, we can see folders and subfolders in the SharePoint document library web part breadcrumb.

  • Documents -> SharePoint Document Library
  • General -> Main Folder
  • Test Folder -> Sub Folder
  • Sample Text -> Sub Sub Folder
set Document Library web part to specific folder
set Document Library web part to a specific folder

Now in this example, we will try to display the Sample Text folder in the modern SharePoint document library web part.

set Document Library web part to a specific folder example
set Document Library web part to a specific folder example

Now we can see the expected output as shown below:

set Document Library web part to specific folder example
set Document Library web part to specific folder example
  • To display the nested folders in a document library web part, we have to type the path separated by ‘/’.
  • There should not be any empty space while specifying a folder path.
  • We have to specify the correct folder path, else it displays This path is not valid as shown below:
Document Library web part to a specific folder example
Document Library web part to a specific folder example

This is how we can Set or open the Document Library web part to a Specific folder in SharePoint online.

See also  How to get file modification time and date using PowerShell

Read How to create a calculated column in SharePoint List or Library

Document Library tree view web part in SharePoint online

  • Currently, there is no direct way or settings to inject the document library tree view web part in the SharePoint Online modern experience.
  • Using SharePoint Framework (SPFX) to inject tree view in a Document Library web part in modern SharePoint. [Follow]

SharePoint multiple document library web part

  • Yes, it is possible to display multiple document libraries’ web parts in the same SharePoint online site page.
  • We can add multiple document library web parts to our SharePoint modern site page.
  • Using the Document Library web part multiple times we can choose a library that we want to display.
  • We can also select every library that we want to show in a document library web part.

Read Get all lists and document libraries programmatically using CSOM in SharePoint Online

SharePoint document library web part 30 items

  • In a document library web part, by default, it will display the first 30 items when we select Autosize -fit to a number of items.
SharePoint document library web part 30 items
SharePoint document library web part 30 items
  • But when we click See All in a Document Library web part, it reloads the items and displays all the items available in a document library.
SharePoint online document library web part 30 items
SharePoint Online document library web part 30 items
  • For example, if we have 150 items in a document library and added with the document library web part in a modern SharePoint site page.
  • Then initially it will display only 30 items and when we select the See all option at the right of the document library web part, we can view all the items available in a document library web part.

SharePoint Online document library web part navigation

  • In the modern SharePoint document library web part, when a user clicks on the folder it opens and shows the documents inside.
  • In the same way, the user can go back to the parent folder with clickable breadcrumbs.
  • Using breadcrumbs, users can easily navigate to the parent folders, subfolders, or nested folders in the Modern SharePoint Document library web part.

Related SharePoint tutorials:

In this SharePoint tutorial, we learned the SharePoint Online Document Library web part, and how to add the document library web part to the SharePoint Online modern site page. And also covered below topics:

  • How to add Document Library web part in SharePoint online
  • Modern SharePoint document library web part remove see all
  • SharePoint Online document library web part column width
  • SharePoint document library web part from another site
  • Dynamic Filtering in SharePoint modern Document Library web part
  • SharePoint Online document library web part breadcrumb
  • How to Set Document Library web part to Specific folder.
  • Document Library tree view web part in SharePoint online
  • SharePoint multiple document library web part
  • SharePoint document library web part 30 items
  • SharePoint Online document library web part navigation

>