> ## Documentation Index
> Fetch the complete documentation index at: https://mahmoud-b28887f9.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# KPDF toolbar configuration types and style reference

> Complete reference for KPdfViewerToolbarConfig, Visibility, Strings, Icons, and Style — the five data classes that control every aspect of the KPDF toolbar.

`KPdfViewerToolbar` is controlled entirely through five configuration data classes. You compose them together into a `KPdfViewerToolbarConfig` that you pass to the `config` parameter of `KPdfViewerToolbar`, and separately a `KPdfViewerToolbarStyle` for visual appearance. Every class ships with a `defaults()` companion factory so you can use `.copy(…)` to override only the fields you care about without boilerplate.

## KPdfViewerToolbarConfig

The top-level configuration object. Holds visibility, string labels, and icon slots for every toolbar chip.

```kotlin theme={null}
data class KPdfViewerToolbarConfig(
    val visibility: KPdfViewerToolbarVisibility,
    val strings: KPdfViewerToolbarStrings,
    val icons: KPdfViewerToolbarIcons,
)
```

<ParamField path="visibility" type="KPdfViewerToolbarVisibility" required>
  Controls which chips are rendered. All chips are visible by default. See [`KPdfViewerToolbarVisibility`](#kpdfviewertoolbarvisibility) below.
</ParamField>

<ParamField path="strings" type="KPdfViewerToolbarStrings" required>
  Provides the label text (and lambda formatters) for every chip. See [`KPdfViewerToolbarStrings`](#kpdfviewertoolbarstrings) below.
</ParamField>

<ParamField path="icons" type="KPdfViewerToolbarIcons" required>
  Provides the optional leading icon composable for every chip. See [`KPdfViewerToolbarIcons`](#kpdfviewertoolbaricons) below.
</ParamField>

**Companion:** `KPdfViewerToolbarConfig.defaults()` is a `@Composable` function that returns an instance populated with `KPdfViewerToolbarVisibility()`, `KPdfViewerToolbarStrings.defaults()`, and `KPdfViewerToolbarIcons.defaults()`.

***

## KPdfViewerToolbarVisibility

Controls which chips the toolbar renders. Every field is a `Boolean` that defaults to `true`, so all chips are shown unless you explicitly set a field to `false`.

```kotlin theme={null}
data class KPdfViewerToolbarVisibility(
    val showPageSummary: Boolean = true,
    val showZoomOut: Boolean = true,
    val showZoomPercentage: Boolean = true,
    val showZoomIn: Boolean = true,
    val showSave: Boolean = true,
    val showShare: Boolean = true,
    val showThumbnailToggle: Boolean = true,
)
```

<ParamField path="showPageSummary" type="Boolean">
  Show the page summary chip that displays the current page number and total page count. Rendered with the `Accent` chip style. Default: `true`.
</ParamField>

<ParamField path="showZoomOut" type="Boolean">
  Show the zoom-out chip. The chip is automatically disabled when the viewer is already at `minZoom`. Default: `true`.
</ParamField>

<ParamField path="showZoomPercentage" type="Boolean">
  Show the read-only zoom percentage chip. Rendered with the `Tonal` chip style. Default: `true`.
</ParamField>

<ParamField path="showZoomIn" type="Boolean">
  Show the zoom-in chip. The chip is automatically disabled when the viewer is already at `maxZoom`. Default: `true`.
</ParamField>

<ParamField path="showSave" type="Boolean">
  Show the save chip. Tapping it calls `viewerState.requestSave()` internally. Default: `true`.
</ParamField>

<ParamField path="showShare" type="Boolean">
  Show the share chip. You supply the `onShareClick` handler to `KPdfViewerToolbar` directly; the SDK does not implement sharing. Default: `true`.
</ParamField>

<ParamField path="showThumbnailToggle" type="Boolean">
  Show the thumbnail-strip toggle chip. Its label and icon change based on the current `isThumbnailStripVisible` value. Default: `true`.
</ParamField>

***

## KPdfViewerToolbarStrings

Provides every text label shown in the toolbar. Lambda fields receive runtime values so you can produce dynamic strings without holding external state.

```kotlin theme={null}
data class KPdfViewerToolbarStrings(
    val pageSummaryText: (currentPage: Int, pageCount: Int) -> String,
    val zoomPercentageText: (zoomPercent: Int) -> String,
    val zoomOutText: String,
    val zoomInText: String,
    val saveText: String,
    val shareText: String,
    val thumbnailToggleText: (isVisible: Boolean) -> String,
)
```

<ParamField path="pageSummaryText" type="(currentPage: Int, pageCount: Int) -> String">
  Formats the page summary chip label. Receives the 1-based current page number and the total page count. Default: `"Page $currentPage / $pageCount"`, or `"Page --"` when `pageCount` is `0`.
</ParamField>

<ParamField path="zoomPercentageText" type="(zoomPercent: Int) -> String">
  Formats the zoom percentage label. Receives the current zoom level as an integer percentage (e.g. `150` for 1.5×). Default: `"$zoomPercent%"`.
</ParamField>

<ParamField path="zoomOutText" type="String">
  Label for the zoom-out chip. Default: `"Zoom Out"`.
</ParamField>

<ParamField path="zoomInText" type="String">
  Label for the zoom-in chip. Default: `"Zoom In"`.
</ParamField>

<ParamField path="saveText" type="String">
  Label for the save chip. Default: `"Save"`.
</ParamField>

<ParamField path="shareText" type="String">
  Label for the share chip. Default: `"Share"`.
</ParamField>

<ParamField path="thumbnailToggleText" type="(isVisible: Boolean) -> String">
  Formats the thumbnail-toggle chip label. Receives `true` when the strip is currently visible. Default: `"Hide Thumbnails"` when visible, `"Show Thumbnails"` when hidden.
</ParamField>

**Companion:** `KPdfViewerToolbarStrings.defaults()` returns the defaults described above. It is a plain (non-`@Composable`) factory.

***

## KPdfViewerToolbarIcons

Provides the optional leading icon composable for each chip. Every field is typed as `KPdfToolbarIcon?`, which is a typealias for `@Composable () -> Unit`. Set a field to `null` to remove the leading icon for that chip.

```kotlin theme={null}
typealias KPdfToolbarIcon = @Composable () -> Unit

data class KPdfViewerToolbarIcons(
    val pageSummaryIcon: KPdfToolbarIcon? = null,
    val zoomPercentageIcon: KPdfToolbarIcon? = null,
    val zoomOutIcon: KPdfToolbarIcon? = null,
    val zoomInIcon: KPdfToolbarIcon? = null,
    val saveIcon: KPdfToolbarIcon? = null,
    val shareIcon: KPdfToolbarIcon? = null,
    val thumbnailVisibleIcon: KPdfToolbarIcon? = null,
    val thumbnailHiddenIcon: KPdfToolbarIcon? = null,
)
```

<ParamField path="pageSummaryIcon" type="KPdfToolbarIcon?">
  Leading icon for the page summary chip. Default: a text glyph `"Pg"`.
</ParamField>

<ParamField path="zoomPercentageIcon" type="KPdfToolbarIcon?">
  Leading icon for the zoom percentage chip. Default: a text glyph `"%"`.
</ParamField>

<ParamField path="zoomOutIcon" type="KPdfToolbarIcon?">
  Leading icon for the zoom-out chip. Default: a text glyph `"-"`.
</ParamField>

<ParamField path="zoomInIcon" type="KPdfToolbarIcon?">
  Leading icon for the zoom-in chip. Default: a text glyph `"+"`.
</ParamField>

<ParamField path="saveIcon" type="KPdfToolbarIcon?">
  Leading icon for the save chip. Default: a text glyph `"S"`.
</ParamField>

<ParamField path="shareIcon" type="KPdfToolbarIcon?">
  Leading icon for the share chip. Default: a text glyph `"Sh"`.
</ParamField>

<ParamField path="thumbnailVisibleIcon" type="KPdfToolbarIcon?">
  Leading icon shown on the thumbnail-toggle chip when the strip is currently **visible**. Default: a text glyph `"T"`.
</ParamField>

<ParamField path="thumbnailHiddenIcon" type="KPdfToolbarIcon?">
  Leading icon shown on the thumbnail-toggle chip when the strip is currently **hidden**. Default: a text glyph `"T"`.
</ParamField>

**Companion:** `KPdfViewerToolbarIcons.defaults()` is a `@Composable` function that returns the default text-glyph icons listed above.

***

## KPdfViewerToolbarStyle

Controls the visual appearance of the toolbar container and every chip. All color values are resolved at composition time from `MaterialTheme.colorScheme`, so the toolbar automatically adapts to light and dark themes.

```kotlin theme={null}
data class KPdfViewerToolbarStyle(
    val containerShape: Shape,
    val containerGradientColors: List<Color>,
    val containerBorderColor: Color,
    val containerBorderWidth: Dp,
    val chipShape: Shape,
    val chipColor: Color,
    val tonalChipColor: Color,
    val accentChipColor: Color,
    val disabledChipColor: Color,
    val chipBorderColor: Color,
    val tonalChipBorderColor: Color,
    val accentChipBorderColor: Color,
    val disabledChipBorderColor: Color,
    val chipBorderWidth: Dp,
    val chipContentColor: Color,
    val tonalChipContentColor: Color,
    val accentChipContentColor: Color,
    val disabledChipContentColor: Color,
    val contentPadding: Dp,
    val itemSpacing: Dp,
    val minChipWidth: Dp,
)
```

<ParamField path="containerShape" type="Shape">
  Shape applied to the toolbar row container. Default: `RoundedCornerShape(24.dp)`.
</ParamField>

<ParamField path="containerGradientColors" type="List<Color>">
  Gradient color stops for the horizontal background brush of the toolbar container. Default: a three-stop gradient derived from `surface`, `surfaceContainerLowest`, and `surfaceVariant`.
</ParamField>

<ParamField path="containerBorderColor" type="Color">
  Stroke color for the toolbar container border. Default: `outlineVariant` at 80% opacity.
</ParamField>

<ParamField path="containerBorderWidth" type="Dp">
  Stroke width for the toolbar container border. Default: `1.dp`.
</ParamField>

<ParamField path="chipShape" type="Shape">
  Shape applied to every chip. Default: `RoundedCornerShape(18.dp)`.
</ParamField>

<ParamField path="chipColor" type="Color">
  Container color for `Default`-appearance chips (zoom-out, zoom-in, save, share). Default: `surface` at 92% opacity.
</ParamField>

<ParamField path="tonalChipColor" type="Color">
  Container color for `Tonal`-appearance chips (zoom percentage). Default: `surfaceVariant` at 82% opacity.
</ParamField>

<ParamField path="accentChipColor" type="Color">
  Container color for `Accent`-appearance chips (page summary, active thumbnail toggle). Default: `primaryContainer` at 92% opacity.
</ParamField>

<ParamField path="disabledChipColor" type="Color">
  Container color for disabled chips (zoom-out at min zoom, zoom-in at max zoom). Default: `surfaceVariant` at 55% opacity.
</ParamField>

<ParamField path="chipBorderWidth" type="Dp">
  Stroke width applied to all chip borders. Default: `1.dp`.
</ParamField>

<ParamField path="contentPadding" type="Dp">
  Padding applied inside the toolbar container, surrounding the chip row. Default: `14.dp`.
</ParamField>

<ParamField path="itemSpacing" type="Dp">
  Horizontal spacing between chips. Default: `10.dp`.
</ParamField>

<ParamField path="minChipWidth" type="Dp">
  Minimum width enforced on every chip via `Modifier.widthIn(min = …)`. Prevents very short labels from producing narrow chips. Default: `88.dp`.
</ParamField>

**Companion:** `KPdfViewerToolbarStyle.defaults()` is a `@Composable` function that resolves all color values from the current `MaterialTheme.colorScheme`.

***

## Customization example

Override only the fields you need using `.copy(…)`. The example below hides the share chip, localizes the save and zoom labels, replaces the zoom icons with `Icon` composables from Material3, and increases the minimum chip width.

```kotlin theme={null}
KPdfViewerToolbar(
    state = viewerState,
    isThumbnailStripVisible = thumbnailsVisible,
    onThumbnailToggle = { thumbnailsVisible = it },
    config = KPdfViewerToolbarConfig.defaults().copy(
        visibility = KPdfViewerToolbarVisibility(
            showShare = false,  // hide the share chip entirely
        ),
        strings = KPdfViewerToolbarStrings.defaults().copy(
            saveText = "Export",
            zoomOutText = "Smaller",
            zoomInText = "Bigger",
            pageSummaryText = { current, total ->
                if (total == 0) "—" else "$current of $total"
            },
            thumbnailToggleText = { visible ->
                if (visible) "Close Strip" else "Open Strip"
            },
        ),
        icons = KPdfViewerToolbarIcons.defaults().copy(
            zoomOutIcon = {
                Icon(
                    imageVector = Icons.Default.ZoomOut,
                    contentDescription = "Zoom out",
                )
            },
            zoomInIcon = {
                Icon(
                    imageVector = Icons.Default.ZoomIn,
                    contentDescription = "Zoom in",
                )
            },
            saveIcon = {
                Icon(
                    imageVector = Icons.Default.Download,
                    contentDescription = "Save",
                )
            },
        ),
    ),
    style = KPdfViewerToolbarStyle.defaults().copy(
        minChipWidth = 96.dp,
        itemSpacing = 8.dp,
    ),
)
```

## Notes

* `KPdfViewerToolbarConfig.defaults()` and `KPdfViewerToolbarIcons.defaults()` and `KPdfViewerToolbarStyle.defaults()` are `@Composable` functions. Call them inside a composable scope; do not call them from a ViewModel or outside composition.
* `KPdfViewerToolbarStrings.defaults()` is a plain (non-`@Composable`) factory and can be called anywhere.
* The toolbar uses Material3 `AssistChip` internally. Chip colors and shapes are applied via `AssistChipDefaults`, so they respect Material3 theming and accessibility contrast requirements.
* The chip row is horizontally scrollable, so all chips remain accessible even on narrow screens without any configuration change.
