# Interface: ButtonSettings<Button>

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

# Interface: ButtonSettings\<Button\>

Defined in: [src/settings/buttons.ts:110](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/settings/buttons.ts#L110)

The settings of one button.

## Type Parameters

### Button

`Button` *extends* `string` = `string`

## Properties

### hidden?

> `optional` **hidden?**: `boolean`

Defined in: [src/settings/buttons.ts:121](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/settings/buttons.ts#L121)

Whether the screen hides the button. A hidden toggle, such as `autoCapture`,
keeps the value that the settings give it, so the user cannot change it. If the
host application hides a way out of a screen, such as cancel, it must give the
user another way out. If the host application hides the rectify button of the
edit screen, the `fromEdit` mode of the rectify screen turns off. If it hides
the filter button, the filter mode turns off.

#### Default Value

`false`

***

### onClick?

> `optional` **onClick?**: (`event`) => `void` \| `Promise`\<`void`\>

Defined in: [src/settings/buttons.ts:131](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/settings/buttons.ts#L131)

The handler that runs before the default action of the button. The default
action then runs, unless the handler called
[preventDefault()](ButtonEvent.md#preventdefault). While the handler and the
default action run, other presses do nothing. Only the cancel button of the
capture screen still works. If the handler throws or its promise rejects, the
document scanner reports the error to the console. The default action then
runs, unless the handler called `preventDefault()` before the error.

#### Parameters

##### event

[`ButtonEvent`](ButtonEvent.md)\<`Button`\>

#### Returns

`void` \| `Promise`\<`void`\>
