Data Driven Forms provides several built length validators:

Checks minimal length of the text.

import validatorTypes from '@data-driven-forms/react-form-renderer/validator-types';
{
type: validatorTypes.MIN_LENGTH,
threshold: 5,
}

Checks maximum length of the text.

import validatorTypes from '@data-driven-forms/react-form-renderer/validator-types';
{
type: validatorTypes.MAX_LENGTH,
threshold: 5,
}

Checks exact length of the text.

import validatorTypes from '@data-driven-forms/react-form-renderer/validator-types';
{
type: validatorTypes.EXACT_LENGTH,
threshold: 5
}

number

Threshold of the validator.