Back to all examples

Ask a long answer question with a maximum word count

ReactAngularWeb Components
const [value, setValue] = useState("");
<GoabFormItem
      label="Provide more detail"
      helpText="Maximum 500 words. Do not include personal or financial information."
    >
      <GoabTextarea
        name="program"
        onChange={(e) => setValue(e.value)}
        value={value}
        width="100%"
        rows={6}
        maxCount={500}
        countBy="word"
      />
    </GoabFormItem>

Restrict a long answer input to a maximum number of words or characters.

When to use

Use this pattern when:

  • Collecting open-ended responses
  • You need to limit response length
  • Users benefit from seeing remaining word count

Considerations

  • Choose between word count or character count based on the use case
  • Provide clear guidance on expected response length
  • Show remaining count to help users gauge their response