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.
KPdfViewerToolbar is a horizontally scrollable row of AssistChip controls that connects directly to a KPdfViewerState. It displays a live page summary, zoom percentage, zoom in/out buttons, a save action, a share action, and a thumbnail strip toggle — all driven by the same state instance you pass to KPdfViewer. Every visible element, label, icon, and visual style is replaceable through configuration objects.
Signature
Parameters
The shared state holder. The toolbar observes
loadState, currentPageIndex, and currentZoom to render live values and enable or disable controls.Controls the appearance of the thumbnail toggle chip and is the source of truth for strip visibility. Manage this with a
remember { mutableStateOf(true) } in the parent composable.Called when the user taps the thumbnail toggle chip. The argument is the new desired visibility value. Update your
isThumbnailStripVisible state here.Applied to the outer toolbar container. Use it to set width, padding, or elevation.
Called when the user taps the zoom-in chip. Disabled automatically when the current zoom equals
state.config.maxZoom. Pass null to hide the chip entirely via KPdfViewerToolbarVisibility.Called when the user taps the zoom-out chip. Disabled automatically when the current zoom equals
state.config.minZoom. Pass null to hide the chip entirely via KPdfViewerToolbarVisibility.Called when the user taps the save chip. The default triggers the SDK-integrated save/export flow. Pass
null to remove the chip.Called when the user taps the share chip. No default implementation is provided — supply your own platform-specific share logic. The chip is hidden when this is
null unless you set showShare = true in KPdfViewerToolbarVisibility.Controls which chips are visible and what text and icons they display. See KPdfViewerToolbarConfig below.
Controls the visual appearance of the toolbar container and its chips. See KPdfViewerToolbarStyle below.
KPdfViewerToolbarConfig
KPdfViewerToolbarConfig groups the three configuration objects that control what the toolbar shows and how it labels its controls.
KPdfViewerToolbarConfig.defaults() to get the default instance, then use .copy(...) to override individual fields.
KPdfViewerToolbarVisibility
Controls which chips render in the toolbar. All fields default totrue.
Show the page summary chip (e.g. “Page 3 / 12”).
Show the zoom-out chip.
Show the current zoom percentage chip (e.g. “150%”).
Show the zoom-in chip.
Show the save chip.
Show the share chip.
Show the thumbnail strip toggle chip.
KPdfViewerToolbarStrings
Provides the label text for each chip. Lambda fields receive live values from state so you can format strings dynamically.Formats the page summary label. Default:
"Page 3 / 12". Receives the 1-based current page number and the total page count.Formats the zoom percentage label. Default:
"150%".Label for the zoom-out chip.
Label for the zoom-in chip.
Label for the save chip.
Label for the share chip.
Formats the thumbnail toggle label based on current strip visibility. Default:
"Hide Thumbnails" when visible, "Show Thumbnails" when hidden.KPdfViewerToolbarIcons
Supplies a leading icon composable for each chip. All fields are optional — passnull to render a chip with no icon.
Icon shown in the page summary chip.
Icon shown in the zoom percentage chip.
Icon shown in the zoom-out chip.
Icon shown in the zoom-in chip.
Icon shown in the save chip.
Icon shown in the share chip.
Icon shown in the thumbnail toggle chip when the strip is currently visible.
Icon shown in the thumbnail toggle chip when the strip is currently hidden.
KPdfViewerToolbarStyle
Controls the visual appearance of the toolbar container and every chip variant. CallKPdfViewerToolbarStyle.defaults() for a Material3-matched default, then .copy(...) to override individual fields.
Minimum width applied to every chip. Increase this to keep chips a consistent size when labels vary in length.
Shape of the toolbar background container.
Shape applied to every chip.
Horizontal gradient colors for the toolbar background. Defaults to a surface-to-surfaceVariant gradient derived from
MaterialTheme.colorScheme.Color of the 1 dp border around the toolbar container.
Background color for default-appearance chips (interactive action chips).
Background color for tonal chips (the zoom percentage display).
Background color for accent chips (the page summary and active thumbnail toggle).
Padding inside the toolbar container, around the chip row.
Horizontal spacing between chips.
Default usage
onShareClick defaults to null, so the share chip is not interactive unless you provide a handler. The chip still renders when showShare = true in KPdfViewerToolbarVisibility. To implement sharing, call viewerState.exportPdf() and pass the resulting bytes to your platform share sheet.Full customization example
Override labels, icons, visibility, and style in a single call using.copy(...) on the defaults.