# Interface: DocumentCorrectionViewToolbarButtonsConfig

[Mobile Document Scanner API Reference](../index.md) / DocumentCorrectionViewToolbarButtonsConfig

# Interface: DocumentCorrectionViewToolbarButtonsConfig

Defined in: [src/views/DocumentCorrectionView.ts:82](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/views/DocumentCorrectionView.ts#L82)

Configuration interface for customizing toolbar buttons in the [DocumentCorrectionView](../classes/DocumentNormalizerView.md).

## Remarks

This interface allows you to customize the appearance and behavior of the toolbar buttons displayed in the [DocumentCorrectionView](../classes/DocumentNormalizerView.md). Each button can be configured using a [ToolbarButtonConfig](../type-aliases/ToolbarButtonConfig.md) object to modify its icon, label, CSS class, or visibility.

The behaviors described for each button below are the default behaviors. You can override the default behavior by providing a custom [ToolbarButton.onClick](ToolbarButton.md#onclick) handler through the [ToolbarButtonConfig](../type-aliases/ToolbarButtonConfig.md).

## Examples

Customize button appearance:
```javascript
const documentScanner = new Dynamsoft.DocumentScanner({
    license: "YOUR_LICENSE_KEY_HERE",
    correctionViewConfig: {
        toolbarButtonsConfig: {
            fullImage: {
                isHidden: true
            },
            detectBorders: {
                icon: "path/to/new_icon.png",
                label: "Custom Label"
            }
        }
    }
});
```

Override button behavior with custom onClick handler:
```javascript
const documentScanner = new Dynamsoft.DocumentScanner({
    license: "YOUR_LICENSE_KEY_HERE",
    correctionViewConfig: {
        toolbarButtonsConfig: {
            apply: {
                label: "Confirm",
                onClick: async () => {
                    // Custom confirmation logic
                    await validateBoundaries();
                    console.log("Boundaries confirmed!");
                }
            }
        }
    }
});
```

## Properties

### apply?

> `optional` **apply?**: `Partial`\<`Pick`\<[`ToolbarButton`](ToolbarButton.md), `"icon"` \| `"label"` \| `"className"` \| `"isHidden"`\>\>

Defined in: [src/views/DocumentCorrectionView.ts:109](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/views/DocumentCorrectionView.ts#L109)

Configuration for the apply button. Default behavior: applies the current boundary adjustments and proceeds with the workflow.

#### Remarks

In continuous scanning mode ([DocumentScannerConfig.enableContinuousScanning](DocumentScannerConfig.md#enablecontinuousscanning)) when [DocumentResultView](../classes/DocumentResultView.md) is disabled, this button is labeled "Keep Scan" by default and returns to the [DocumentScannerView](../classes/DocumentScannerView.md) for the next scan. Otherwise, it is labeled "Apply" when [DocumentResultView](../classes/DocumentResultView.md) is shown, or labeled "Done" otherwise.

***

### detectBorders?

> `optional` **detectBorders?**: `Partial`\<`Pick`\<[`ToolbarButton`](ToolbarButton.md), `"icon"` \| `"label"` \| `"className"` \| `"isHidden"`\>\>

Defined in: [src/views/DocumentCorrectionView.ts:100](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/views/DocumentCorrectionView.ts#L100)

Configuration for the detect borders button. Default behavior: automatically detects document boundaries using the document detection algorithm.

***

### fullImage?

> `optional` **fullImage?**: `Partial`\<`Pick`\<[`ToolbarButton`](ToolbarButton.md), `"icon"` \| `"label"` \| `"className"` \| `"isHidden"`\>\>

Defined in: [src/views/DocumentCorrectionView.ts:94](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/views/DocumentCorrectionView.ts#L94)

Configuration for the full image button. Default behavior: sets the document boundaries to match the full image dimensions.

***

### retake?

> `optional` **retake?**: `Partial`\<`Pick`\<[`ToolbarButton`](ToolbarButton.md), `"icon"` \| `"label"` \| `"className"` \| `"isHidden"`\>\>

Defined in: [src/views/DocumentCorrectionView.ts:88](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/views/DocumentCorrectionView.ts#L88)

Configuration for the retake button. Default behavior: returns to the [DocumentScannerView](../classes/DocumentScannerView.md) to capture a new image.
