Skip to content

PasswordField

PasswordField provides a masked text entry backed by the PrimeReact InputPassword component, bound to a string property on a command.

import { CommandDialog } from '@cratis/components/CommandDialog';
import { PasswordField } from '@cratis/components/CommandForm';
<CommandDialog command={SetPassword} visible={visible} onCancel={() => setVisible(false)}>
<PasswordField<SetPassword> value={c => c.password} placeholder="At least 8 characters" />
</CommandDialog>
PropTypeDefaultDescription
value(instance: TCommand) => unknownRequired. Accessor 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.
classNamestringExtra CSS class combined with the default w-full.
ptInputPasswordProps['pt']PrimeReact pass-through configuration for the underlying InputPassword.
ptOptionsInputPasswordProps['ptOptions']PrimeReact pass-through options.
unstyledbooleanfalseDisables every base PrimeReact style on the underlying InputPassword.
  • Default value is an empty string.
  • The input masks its content; the underlying InputPassword provides the show/hide affordance.
  • Validation state is reflected via the PrimeReact invalid flag.