PdfViewerTopBar

actual fun PdfViewerTopBar(title: String, modifier: Modifier, titleOverflow: PdfTopBarTitleOverflow, subtitle: String?, backLabel: String?, onBack: () -> Unit, onSearch: () -> Unit, onShare: () -> Unit, onPrint: () -> Unit, onDownload: () -> Unit, onAnnotate: () -> Unit, showBack: Boolean, showSearch: Boolean, showShare: Boolean, showPrint: Boolean, showDownload: Boolean, showAnnotate: Boolean, annotateActive: Boolean)

Android default — delegates to PdfViewerTopBarMinimalMono.

backLabel is intentionally accepted but ignored: Material's back affordance is glyph-only, so emulating iOS's "Files →" prefix on Android would clash with platform conventions.

expect fun PdfViewerTopBar(title: String, modifier: Modifier = Modifier, titleOverflow: PdfTopBarTitleOverflow = PdfTopBarTitleOverflow.Ellipsis, subtitle: String? = null, backLabel: String? = null, onBack: () -> Unit = {}, onSearch: () -> Unit = {}, onShare: () -> Unit = {}, onPrint: () -> Unit = {}, onDownload: () -> Unit = {}, onAnnotate: () -> Unit = {}, showBack: Boolean = true, showSearch: Boolean = false, showShare: Boolean = true, showPrint: Boolean = false, showDownload: Boolean = true, showAnnotate: Boolean = false, annotateActive: Boolean = false)

Platform-aware default topbar for PdfViewer. Picks the design direction the host platform expects out of the box:

Both variants are public composables in their own right — call them directly when you need to pin a specific look (e.g. a cross-platform Material-style topbar on iOS as well).

Each action button can be hidden via the matching show… flag without removing the wired callback. The search affordance is false by default since search is opt-in — wire onSearch and set showSearch to true to surface it.

subtitle only shows up in the Minimal Mono variant; the iOS variant has no room for it. backLabel only shows up in the iOS variant.

Parameters

title

filename / document name.

modifier

applied to the outer container.

titleOverflow

how the title behaves when it is too long to fit. PdfTopBarTitleOverflow.Ellipsis (default) truncates with like Android; PdfTopBarTitleOverflow.Marquee scrolls it. The back affordance and the action icons keep their size on both platforms — only the title yields.

subtitle

UPPERCASE meta line for Minimal Mono — typically "PDF · 2.4 MB".

backLabel

iOS-only previous-screen label rendered next to the chevron (e.g. "Files"). Ignored on Android.

onBack

callback when the back affordance is tapped.

onSearch

callback when the search affordance is tapped.

onShare

callback when the share affordance is tapped.

onPrint

callback when the print affordance is tapped.

onDownload

callback when the download affordance is tapped.

onAnnotate

callback when the highlight-annotation toggle is tapped. Surfaced only when showAnnotate is true.

showBack

visibility of the back affordance.

showSearch

visibility of the search affordance.

showShare

visibility of the share affordance.

showPrint

visibility of the print affordance. false by default since printing is opt-in — wire onPrint and set this to true to surface it.

showDownload

visibility of the download affordance.

showAnnotate

visibility of the highlight-annotation toggle. false by default — annotation tools are opt-in.

annotateActive

whether annotation mode is currently on, so the toggle can render an "active" treatment.

actual fun PdfViewerTopBar(title: String, modifier: Modifier, titleOverflow: <Error class: unknown class>, subtitle: String?, backLabel: String?, onBack: () -> Unit, onSearch: () -> Unit, onShare: () -> Unit, onPrint: () -> Unit, onDownload: () -> Unit, onAnnotate: () -> Unit, showBack: Boolean, showSearch: Boolean, showShare: Boolean, showPrint: Boolean, showDownload: Boolean, showAnnotate: Boolean, annotateActive: Boolean)

iOS default — delegates to PdfViewerTopBarClassicIos.

subtitle is intentionally accepted but ignored: the Classic iOS topbar is 52dp tall with no room for a second line, matching Mail / Files / Notes conventions.

actual fun PdfViewerTopBar(title: String, modifier: Modifier, titleOverflow: PdfTopBarTitleOverflow, subtitle: String?, backLabel: String?, onBack: () -> Unit, onSearch: () -> Unit, onShare: () -> Unit, onPrint: () -> Unit, onDownload: () -> Unit, onAnnotate: () -> Unit, showBack: Boolean, showSearch: Boolean, showShare: Boolean, showPrint: Boolean, showDownload: Boolean, showAnnotate: Boolean, annotateActive: Boolean)

Desktop default — delegates to PdfViewerTopBarMinimalMono, the same brand-neutral, Material-flavoured bar Android uses. It reads naturally with a mouse and keyboard, where the iOS chevron-and-label convention would feel out of place.

backLabel is accepted but ignored, mirroring the Android backend.