Skip to content

PasswordField

PasswordField provides a Cratis-owned masked text input with a labeled show/hide action.

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.
ptcomponent-specific partsCratis-owned HTML attributes for stable parts.
ptOptionsobjectLegacy compatibility prop; ignored.
unstyledbooleanfalseLegacy compatibility prop; ignored.
  • Default value is an empty string.
  • The input masks its content; the underlying InputPassword provides the show/hide affordance.
  • Validation state is reflected through aria-invalid and data-invalid.