Skip to content

TextAreaField

TextAreaField wraps the PrimeReact InputTextarea component for multi-line text input.

import { CommandDialog } from '@cratis/components/CommandDialog';
import { TextAreaField } from '@cratis/components/CommandForm';
<CommandDialog command={MyCommand} visible={visible} onCancel={() => setVisible(false)}>
<TextAreaField<MyCommand> value={c => c.description} placeholder="Enter a description" rows={4} />
<TextAreaField<MyCommand> value={c => c.notes} rows={3} />
</CommandDialog>
PropTypeDefaultDescription
value(instance: TCommand) => unknownRequired. Accessor function that returns the bound property from the command instance. Pass the command type as the generic parameter for full type safety.
placeholderstringPlaceholder text shown when the field is empty.
rowsnumber5Number of visible text rows.
colsnumberNumber of visible text columns.
  • Default value is an empty string.
  • The field spans full width within its container.
  • Validation state is reflected via the PrimeReact invalid flag.