werkbank
    Preparing search index...
    • A password input component with a toggle to show/hide the password.

      Type Parameters

      • Schema extends BaseSchema<any, any, any>

      Parameters

      Returns Element

      The rendered password input with a toggle button.

      Wraps the Input component and adds a button to toggle the type attribute between "password" and "text".

      import { string, minLength } from 'valibot';
      import { Password } from './input';

      const passwordSchema = string([minLength(8)]);

      function PasswordField() {
      return (
      <Password
      name="password"
      validate={passwordSchema}
      autoComplete="current-password"
      />
      );
      }