Documentation Index
Fetch the complete documentation index at: https://mahmoud-b28887f9.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
KPdfThumbnailStrip renders a horizontally scrollable row of page preview thumbnails connected to the same KPdfViewerState as your main viewer. It automatically scrolls to keep the current page in view, highlights the selected thumbnail with a distinct border, and calls onPageClick when the user taps a thumbnail. Thumbnails render at a fixed low resolution to keep memory usage low regardless of document length.
Signature
Parameters
The shared state holder. The strip observes
loadState to determine page count and currentPageIndex to track which thumbnail is selected and to drive auto-scroll.Applied to the outer
Surface container. Use it to constrain the height, set padding, or clip the strip to a shape.Called when the user taps a thumbnail. Receives the 0-based page index. The default calls
state.goToPage(pageIndex) to navigate the main viewer. Pass null to make thumbnails non-interactive.Width of each thumbnail card in the strip.
Height of each thumbnail card in the strip.
Padding applied around the list of thumbnails inside the strip container.
Horizontal spacing between individual thumbnail cards.
Controls the colors, shapes, borders, and elevation of the strip and its thumbnails. See KPdfThumbnailStripStyle below.
Rendering behavior
- Auto-scroll — whenever
currentPageIndexchanges, the strip animates to the corresponding thumbnail usingLazyListState.animateScrollToItem. - Low-quality thumbnails — each page is rendered at
thumbnailWidth × thumbnailHeightpixels at zoom1f. This keeps memory usage predictable even for long documents. - Loading state — each thumbnail shows a
CircularProgressIndicatorwhile its page renders asynchronously. - Error state — if a page fails to render, the thumbnail shows the error message. Tapping an error thumbnail retries the render.
- Empty state — if the document has no pages yet (still loading), the strip displays a “No pages” placeholder at the configured height.
Thumbnails render independently per item. Scrolling quickly through a large document will trigger renders for newly visible thumbnails on demand, not all at once.
KPdfThumbnailStripStyle
Controls the visual appearance of the strip container and each thumbnail card. CallKPdfThumbnailStripStyle.defaults() for Material3-matched defaults, then use .copy(...) to override individual fields.
Shape of the outer strip container surface.
Background color of the strip surface. Defaults to
colorScheme.surfaceVariant at 32% alpha.Shape of each individual thumbnail card.
Background color for unselected thumbnails. Defaults to
colorScheme.surface.Background color for the selected thumbnail. Defaults to
colorScheme.surface.Border color for unselected thumbnails. Defaults to
colorScheme.outlineVariant.Border color for the selected thumbnail. Defaults to
colorScheme.primary.Border stroke width for unselected thumbnails.
Border stroke width for the selected thumbnail.
Tonal elevation for unselected thumbnails.
Tonal elevation for the selected thumbnail.
Padding applied around the rendered page image inside each thumbnail card.
Color of the page number label below unselected thumbnails. Defaults to
colorScheme.onSurfaceVariant.Color of the page number label below the selected thumbnail. Defaults to
colorScheme.primary.Background color of the thumbnail placeholder while a page is rendering.
Background color of the thumbnail when a page fails to render.
Text color of the error message displayed inside a failed thumbnail.
Default usage
Passstate and an onPageClick handler that calls goToPage to navigate the main viewer.
Disabling tap navigation
PassonPageClick = null to render the strip as a read-only page overview with no tap interaction. The strip still auto-scrolls to track the current page.
Custom dimensions
AdjustthumbnailWidth and thumbnailHeight to match your layout. The strip height in your layout should be at least thumbnailHeight plus the vertical contentPadding plus the page number label height.
Custom style
UseKPdfThumbnailStripStyle.defaults().copy(...) to override colors without losing the Material3 defaults for the fields you do not change.
Full layout example
The snippet below showsKPdfThumbnailStrip wired into a complete screen alongside KPdfViewerToolbar and KPdfViewer, with visibility controlled by the toolbar’s thumbnail toggle.