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

# clamp

```ts theme={null}
function clamp(
   value: number, 
   min: number, 
   max: number): number;
```

Clamp a value between a minimum and maximum value.

## Parameters

| Parameter | Type     | Description         |
| --------- | -------- | ------------------- |
| `value`   | `number` | The value to clamp. |
| `min`     | `number` | The minimum value.  |
| `max`     | `number` | The maximum value.  |

## Returns

`number`

The clamped value.
