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

# String: Length between

> Checks that a string's length is between a minimum and maximum value.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Checks that a string's length is between a minimum and maximum value. A value passes when its number of characters falls within the range you set, counting both ends of the range as valid. Use this to confirm that a value is neither too short nor too long, for example a password that must be 6 to 12 characters or a description that must stay within a size limit.

This documentation describes: [Schema](/schemas/condition/string-length-between)

## Fields

<FormField property="min" label="Minimum">
  The smallest number of characters the value may have. A value shorter than this does not match.
</FormField>

<FormField property="max" label="Maximum">
  The largest number of characters the value may have. A value longer than this does not match. Leave it empty to set only a minimum, with no upper limit.
</FormField>

## Sample data

| Field   | Value |
| ------- | ----- |
| Minimum | `6`   |
| Maximum | `12`  |

The condition checks each value and answers yes or no:

| Example value                   | Matches?           |
| ------------------------------- | ------------------ |
| `secret`                        | Yes (6 characters) |
| `pw`                            | No (too short)     |
| `this-password-is-way-too-long` | No (too long)      |

```json Configuration theme={null}
{
  "prototype": "string-length-between",
  "parameters": {
    "min": 6,
    "max": 12
  }
}
```
