---
title: "maxLength"
source: "https://github.com/remix-run/remix/blob/8905f3943706e1f53696ab83e70a84873cabfc90/packages/data-schema/src/lib/checks.ts#L26"
---

# maxLength

## Summary

Require a string to be at most `length` characters long.

## Signature

```ts
function maxLength(length: number): Check<string>

```

## Parameters

### `length`

The maximum number of characters

## Returns

A [`Check`](/data-schema/type/Check/) that enforces the maximum length