Skip to content

InputTextField

InputTextField wraps the PrimeReact InputText component for single-line text input. It supports all standard HTML input types.

import { CommandDialog } from '@cratis/components/CommandDialog';
import { InputTextField } from '@cratis/components/CommandForm';
<CommandDialog command={MyCommand} visible={visible} onCancel={() => setVisible(false)}>
<InputTextField<MyCommand> value={c => c.username} placeholder="Enter username" />
<InputTextField<MyCommand> value={c => c.email} type="email" placeholder="Enter email" />
<InputTextField<MyCommand> value={c => c.password} type="password" />
</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.
type'text' | 'email' | 'password' | 'color' | 'date' | 'datetime-local' | 'time' | 'url' | 'tel' | 'search''text'The HTML input type.
placeholderstringPlaceholder text shown when the field is empty.
  • Default value is an empty string.
  • The field spans full width within its container.
  • Validation state is reflected via the PrimeReact invalid flag.