# clear

## Description

A function to clear the canvas and allow users to redraw the signature.

## Input / Parameter

| Name      | Description                          | Input Type | Default | Options | Required |
| --------- | ------------------------------------ | ---------- | ------- | ------- | -------- |
| component | The name of the signature component. | Text       | -       | -       | Yes      |

## Output

Note: The signature component will be updated and clear the canvas.

## Example

In this example, we will clear the current signature canvas.

### Steps

1. Drag a `signature` and `button` component into the canvas and open the `Action` tab. Label the button "Clear".

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-5b914436ab3df1ded6ff8b0ed9b6f9f6b555c028%2Fclear-step-1.png?alt=media)
2. Select the `press` event of the button component and drag the `Signature.clear` function to the event flow. Select the signature component that should be cleared when this button is clicked.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-5d7b952f0182508648dd274656d1e2a0c42745f4%2Fclear-step-2.png?alt=media)
3. Save and preview the app. Sign on the signature component canvas, then click the 'Clear' button to clear the canvas.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-858e2101ce1a057ab2d9cfa826cdfc7c1a061082%2Fclear-step-3.png?alt=media)

### Result

1. The canvas of the signature component specified in the `component` parameter will be cleared.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-86c4e41b17025bd10bafc7cb57d0c3c83e0303ab%2Fclear-result-1.gif?alt=media)

## Links

### Related Information

See also:

* Components
  * [Signature](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/react-native/signature/clear)
