> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supernote.com/llms.txt
> Use this file to discover all available pages before exploring further.

# setLassoBoxState

> Set lasso box state.

<Note>
  You must create a lasso selection before calling this API; otherwise the call fails.
</Note>

```ts theme={null}
static setLassoBoxState(state: number): Promise<APIResponse<boolean>>;
```

**Parameters**

| Parameter | Type     | Description                                                                                              |
| --------- | -------- | -------------------------------------------------------------------------------------------------------- |
| `state`   | `number` | `0` show, `1` hide, `2` remove completely, `3` fully hide (including lasso elements) for custom toolbars |

**Returns**

* [`APIResponse<boolean>`](/en/api-reference/supernote-plugin/types/api-response):
  `result === true` indicates the call succeeded

## Example

```ts wrap theme={null}
import { PluginCommAPI } from 'sn-plugin-lib';

/**
 * Example: set lasso box state.
 */
export async function exampleSetLassoBoxState() {
 const res = await PluginCommAPI.setLassoBoxState(1);
 if (!res.success) {
 throw new Error(res.error?.message ?? 'setLassoBoxState call failed');
 }
 return res.result;
}
```
