Forms
ITextarea
A multi-line field, with the same sizes and states as IInput.
The model is a string, and rows sets the starting height when you are not using autosize.
Autosize
autosize grows the field with its content instead of scrolling it.
Pass an object to bound the growth. min and max are counted in rows.
Character count
showCount adds a count under the field. With maxlength it reads against the limit and turns red in the last tenth. Screen readers only hear it then, so they aren't told the count on every keystroke.
The announcement is English by default. Pass countLabel to translate it:
vue
<ITextarea v-model="bio" show-count :maxlength="160" :count-label="n => `quedan ${n}`" />Sizes
States
Inside an IFormField, invalid is set for you from the validation state.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | 'sm' | 'md' | 'lg' | 'md' | Control scale |
rows | number | — | Starting height, when not autosizing |
autosize | boolean | { min?, max? } | false | Grow with the content, optionally bounded in rows |
placeholder | string | — | Placeholder text |
disabled | boolean | false | Disables the field |
required | boolean | false | Marks it required |
invalid | boolean | — | Error styling; set automatically inside IFormField |
maxlength | number | — | Hard character limit |
showCount | boolean | false | Show a character count under the field |
countLabel | (remaining: number) => string | English | What screen readers announce near the limit |
id | string | generated | Useful when an external ILabel targets it |
unstyled | boolean | — | Drop built-in classes |
class | string | — | Merged with the built-in classes; lands on the wrapper when showCount is on |
For a single line use IInput; for a number, INumberInput.