In SharePoint Online, the List web part (or Document library web part for document libraries) provides a straightforward method to display items exclusively from a specific folder on a modern page.
To configure this:
- Edit the modern page where the web part is located (or add a new one).
- Insert or select the Document library web part (for libraries) or List web part (for custom lists), and connect it to the desired list or library.
- Edit the web part by selecting the pencil icon in its toolbar.
- In the properties pane on the right, locate the Folder field.
- Enter the relative path to the target folder.
- For a top-level folder, enter its name (e.g., Projects).
- For a subfolder, use the full path separated by forward slashes (e.g., Projects/2026 or ParentFolder/SubFolder).
- Select Apply to update the web part, then Republish the page to save changes.
The web part will now display only the items (and subfolders, if present) within the specified folder. This approach leverages the built-in folder scoping capability of the modern web part and does not require custom views, filters, or scripting.