B
Bonzai 2
Web Parts

Documents Table

Display documents in a paginated table format with configurable columns for name, modified date, author, size, and type.

DocumentsFeature Parity: 95%

Get Documents Table Working in 3 Steps

10-20 minutes

Prerequisites

  • Bonzai 2 package installed on your site
  • A document library with files
1

Add the web part

Edit your page and add "Bonzai Documents Table" from the Bonzai category.

2

Select a site and library

Choose a Site Selection Mode (picker or manual URL), then pick your document library from the List picker.

3

Configure columns

Pick visible columns via the "Visible Columns" multi-select (Name, Modified Date, Created Date, Author, File Size, File Type) and set items per page.

When to Use This Web Part

Use this when you need to...

  • Display documents in a structured table
  • Show metadata columns (author, modified, size, type)
  • Create a file browser experience
  • Provide a compact document listing

Best page locations

  • Document library pages — structured browsing
  • Admin pages — file management
  • Archive pages — historical documents
  • Knowledge base pages — organized files

Consider alternatives when...

  • Visual document display — use Documents Rollup
  • Full search — use Document Portal
  • Card-based layouts — use Documents Rollup

Related web parts:

Documents Rollupcard-based or list display with thumbnailsDocument Portalsearch and refinement

Recent Updates

  • New: Site Selection Mode — pick between a Microsoft Graph site picker or a manual URL for cross-site libraries.
  • New: Visible Columns multi-select — replaces the legacy per-column toggles with a single control and adds a Created Date option.
  • New: Additional Library Columns — discovers non-hidden columns from the selected document library so you can surface custom fields alongside the built-ins.
  • Interactive column sorting — clicking any header toggles ascending/descending; the server re-queries with the new order.
  • Automatic file type icons — Word, Excel, PowerPoint, OneNote, Visio, Project, PDF, text, image, video, audio, archive, and code extensions render with matching Fluent UI icons.
  • Server-backed paging — uses SharePoint @odata.nextLink with per-page caching for fast navigation.
  • Promoted field auto-discovery — detects Promoted, Featured, Featured_x003f_, or PromotedState in the target library.
  • Progressive field fallback — the service tries multiple field combinations (including File_x0020_Size vs FileSizeDisplay) so libraries with non-standard schemas still render.
  • Legacy showName, showModified, showAuthor, showSize, showType toggles are still honored, but visibleColumns takes precedence when set.

Common Configurations

Copy these ready-to-use configurations:

Full Document Table

All columns visible with pagination

Best for: Document library page
Configuration
titleDocuments
showNameOn
showModifiedOn
showAuthorOn
showSizeOn
showTypeOn
itemsPerPage20

Compact File List

Name and modified date only

Best for: Dashboard widget
Configuration
titleRecent Files
showNameOn
showModifiedOn
showAuthorOff
showSizeOff
itemsPerPage10

Admin File View

Size and type for file management

Best for: Admin pages
Configuration
titleFile Manager
sortBysize
showNameOn
showSizeOn
showTypeOn
itemsPerPage25

Best Practices

Choose relevant columns

Only show columns that are useful for your audience. Hiding unnecessary columns makes the table cleaner.

Set reasonable page size

10-20 items per page works well. Too many items can slow down the page.

Use Show More link

Add a Show More URL to link to the full document library for users who need to browse more files.

Interactive Features

Sortable column headers

Every visible column header is clickable. Clicking a header re-queries the server with the new sort (and toggles direction if the same column is clicked again). The initial sort comes from the sortBy property — name defaults to ascending, all other columns default to descending.

Clickable file names

The Name column renders the file name as a link that opens the document in a new tab (target="_blank", data-interception="off" so SharePoint does not intercept the navigation). No row-click handler is attached — only the file-name link is interactive.

File type icons

The service maps a document's extension to a Fluent UI icon. Unrecognized extensions fall back to the generic Document icon.

CategoryExtensionsIcon
Worddoc, docx, docmWordDocument
Excelxls, xlsx, xlsm, csvExcelDocument
PowerPointppt, pptx, pptmPowerPointDocument
OneNoteoneOneNoteLogo
Visiovsd, vsdxVisioDocument
ProjectmppProjectDocument
PDFpdfPDF
Texttxt, rtf, logTextDocument
Imagesjpg, jpeg, png, gif, bmp, svgFileImage
Videomp4, avi, mov, wmvVideo
Audiomp3, wavMusicInCollection
Archiveszip, rar, 7zZipFolder
Codehtml, css, js, ts, json, xmlFileCode
Defaultany other extensionDocument

Server-backed pagination

Pagination uses SharePoint's @odata.nextLink so each page is fetched on demand. Visited pages are cached in memory for the lifetime of the component, so clicking back to a previous page is instant. The total count shown in the pagination bar comes from the list'sItemCount metadata and is only displayed when promoted filtering is off (filtered queries fall back to a simple {from}-{to} indicator).

Troubleshooting

Still need help? Contact Bonzai Support


Reference

Document Library Schema

Documents Table uses standard document library fields. No custom columns are required, but you can add a promoted-state column to support promoted filtering. The service auto-discovers the promoted field by scanning the library's column list for known names.

  1. Select an existing document library with files.
  2. Optional: add one of Promoted, Featured, or PromotedState for promoted filtering.
  3. Ensure documents are published and accessible to viewers.
ColumnTypeRequiredNotes
TitleSingle line of textNoDefault library field; falls back to file name without extension
FileLeafRefSingle line of textYesFile name (built-in) — used for the Name column and name sort
FileRefHyperlinkYesServer-relative path (built-in) — resolved to an absolute URL for the file link
ModifiedDate/TimeYesUsed for Modified column and default sort
CreatedDate/TimeNoUsed when the created column is visible or sortBy = created
File_x0020_SizeNumberNoPreferred size field; service falls back to FileSizeDisplay when unavailable
AuthorPersonNoCreator display name (expanded via $expand=Author)
Promoted / Featured / Featured_x003f_ / PromotedStateYes/No or NumberNoPromoted-item filter. The service checks these internal names in order and uses the first one it finds (matches values 1, true, or 'Yes')

Property Pane Configuration

Title Settings

PropertyTypeDescription
titleTextWeb part title displayed above the table
titleUrlTextOptional URL to make the title clickable
titleIconOptionDropdownTitle icon mode: Custom or None
titleIconNameIcon PickerFluent UI icon picker (e.g., Table)
titleIconUrlTextCustom icon URL (overrides icon name)
descriptionText (Multiline)Optional description below the title
showMoreTextTextText for the footer link
showMoreUrlTextURL for the footer link

Data Source Settings

PropertyTypeDefaultDescription
siteSelectionModeDropdownmanualChoose how to pick the source site: picker (dropdown of sites discovered via Microsoft Graph) or manual (type a URL)
selectedSiteUrlDropdownSelected site URL when siteSelectionMode = picker; populated from Graph (/sites?search=*, up to 500 sites, sorted by display name)
siteUrlTextManual site URL when siteSelectionMode = manual. Empty = current site
listNameList PickerDocument library to display (filtered to base template 101). Stores list title and GUID so renames stay resolvable
sortByDropdownmodifiedDefault sort column: name, modified, created, or size (users can re-sort by clicking headers at runtime)
showPromotedItemsToggleOffShow only promoted/featured documents (auto-discovers the promoted field; see schema section below)

Site picker uses Microsoft Graph

When siteSelectionMode is set to picker, the web part calls the Microsoft Graph /sites endpoint on property pane open. If the Graph call fails (for example, due to permissions), the current site is offered as a fallback so the dropdown is never empty.

Column Visibility

The Column Visibility group has two multi-selects. visibleColumns picks which built-in columns to render; dynamicColumns lets you surface custom columns discovered from the selected document library.

PropertyTypeDefaultDescription
visibleColumnsMulti-select["name", "modified", "author", "size"]Built-in columns to render. Options: name, modified, created, author, size, type. When set (non-empty), this property fully replaces the legacy show* toggles
dynamicColumnsMulti-select[]Additional library columns to include. Populated from the selected library's non-hidden fields via the SharePoint REST /fields endpoint

Built-in column options:

KeyHeaderSorted byRendering
nameNameFileLeafRefFile type icon + file name as a link that opens in a new tab
modifiedModifiedModifiedLocalized short date (e.g., Apr 21, 2026)
createdCreatedCreatedLocalized short date
authorAuthorModified (fallback)Plain text (falls back to Unknown if unavailable). Header is clickable but the service does not map author to a server sort field, so the query falls back to Modified
sizeSizeFile_x0020_SizeHuman-readable size (B/KB/MB/GB/TB, 1 decimal)
typeTypeModified (fallback)Uppercase file extension. Header is clickable but the service does not map type to a server sort field, so the query falls back to Modified

Legacy Column Toggles

These boolean properties predate visibleColumns. They are still wired up for backward compatibility — existing configurations keep working — but the multi-select above is preferred for new deployments. When visibleColumns is a non-empty array, the toggles below are ignored.

PropertyTypeDefaultDescription
showNameToggleOnShow the document name column
showModifiedToggleOnShow the modified date column
showAuthorToggleOnShow the author column
showSizeToggleOnShow the file size column
showTypeToggleOffShow the file type column

Created column only via multi-select

The Created Date column exists only in the new visibleColumns multi-select — there is no legacy showCreated toggle. Configurations that still rely onshow* toggles will not render a Created column.

Display Settings

PropertyTypeDescription
itemsPerPageSlider (5-50)Number of documents to display per page
showPagingToggleShow pagination controls
showTableHeadersToggleShow column headers in the table
fixedHeightSlider (0-800)Fixed height in pixels (0 = auto height)
chromeTypeDropdownChrome type: None, Title Only, Border Only, Title and Border

Features Checklist

  • ✅ Tabular document display via Fluent UI DetailsList
  • ✅ Built-in columns: Name, Modified, Created, Author, Size, Type
  • ✅ Multi-select column visibility (visibleColumns) with legacy toggle fallback
  • ✅ Dynamic library columns discovered via REST /fields
  • ✅ Click-to-sort column headers (server-backed)
  • ✅ Default sort options: Name, Modified, Created, Size
  • ✅ Server-backed pagination via @odata.nextLink with per-page caching
  • ✅ Show table headers toggle
  • ✅ Promoted items support with auto-discovered field (Promoted, Featured, Featured_x003f_, PromotedState)
  • ✅ Cross-site data source (manual URL or Microsoft Graph site picker)
  • ✅ Custom title with Fluent icon, custom icon URL, or no icon
  • ✅ Chrome types: None, Title Only, Border Only, Title and Border
  • ✅ Show More link
  • ✅ Fixed height option (0-800px)
  • ✅ Automatic file type icons (~30 extensions)
  • ✅ Clickable file names (open in new tab)
  • ✅ Progressive field fallback for non-standard schemas
  • ✅ License gating via LicenseWrapper