Standard Form Fields

PasswordField

PasswordField masks sensitive credentials with eye icon toggle buttons, caps lock detection, and seamless React Hook Form integration.

Built-in eye icon toggle to reveal or mask passwords
Optional lock prefix icon and custom tooltips
Integrated validation rules (minLength, regex patterns)
Works standalone or within DynamicForm matrix grids

Props & Configuration

8 props

Complete property specifications, parameter types, and default fallbacks.

PropertyTypeDefaultDescription
idRequiredstring—Form state key name.
controlControl<any>—React Hook Form control instance.
labelstring—Field label text.
placeholderstring—Placeholder text.
tooltipstring—Helpful tooltip next to label.
requiredbooleanfalseRequired asterisk indicator.
prefixReact.ReactNode—Prefix icon.
rulesRegisterOptions—Validation rules (minLength, pattern).

Interactive Examples & Live Previews

2 Demos

Every example includes its own live, interactive preview element alongside the corresponding copyable TypeScript snippet.

Example 1

Basic Password Input

Masked password entry with eye visibility toggle.

Live Interactive Demo
React Hook Form Live State:{"testInput":"Sample text","testPassword":"secretPassword123","testSelect":"editor","testNumber":42,"testTextArea":"This is a multi-line text area content for enterprise use.","testSwitch":true,"testCheckbox":true,"testRadio":"b","testSlider":65,"testRating":4,"testColor":"#e05d44","testCountry":"US","testPhone":"+1 (555) 019-2834","testOtp":"123456"}
PasswordField.basic.tsxtsx
1import React from "react";
2import { useForm } from "react-hook-form";
3import { PasswordField } from "antd-dynamic-ui";
4
5export default function BasicPasswordExample() {
6 const { control } = useForm();
7 return (
8 <div className="max-w-md">
9 <PasswordField
10 id="password"
11 control={control}
12 label="Account Password"
13 placeholder="Enter at least 8 characters"
14 required={true}
15 />
16 </div>
17 );
18}
Example 2

Complete Props with Lock Icon & Tooltip

Password field with prefix lock icon, security tooltip, and minLength rules.

Live Interactive Demo
Toggle Props:
disabled:
Input is active & editable
React Hook Form Live State:{"testInput":"Sample text","testPassword":"secretPassword123","testSelect":"editor","testNumber":42,"testTextArea":"This is a multi-line text area content for enterprise use.","testSwitch":true,"testCheckbox":true,"testRadio":"b","testSlider":65,"testRating":4,"testColor":"#e05d44","testCountry":"US","testPhone":"+1 (555) 019-2834","testOtp":"123456"}
PasswordField.complete.tsxtsx
1import React from "react";
2import { useForm } from "react-hook-form";
3import { PasswordField } from "antd-dynamic-ui";
4import { LockOutlined } from "@ant-design/icons";
5
6export default function CompletePasswordExample() {
7 const { control } = useForm();
8 return (
9 <div className="max-w-md">
10 <PasswordField
11 id="securityToken"
12 control={control}
13 label="Master Encryption Key"
14 placeholder="Enter 16+ character passphrase"
15 tooltip="Used for end-to-end payload signing"
16 prefix={<LockOutlined className="text-zinc-400" />}
17 required={true}
18 rules={{ minLength: { value: 16, message: "Key must be at least 16 chars" } }}
19 />
20 </div>
21 );
22}

Frequently Asked Questions & Quick Solutions

Architectural patterns, React 19 compatibility, and integration tips for PasswordField.

How does PasswordField integrate with Ant Design 5.x and Next.js 15?▼

PasswordField is designed as an enhanced, declarative wrapper for Ant Design. It fully supports Next.js 15 App Router when using @ant-design/nextjs-registry, eliminating SSR hydration mismatches and guaranteeing 0ms layout thrashing.

Can I customize validation, themes, and props for PasswordField?▼

Yes. Every prop is fully typed in TypeScript 5 with comprehensive Intellisense. You can pass custom styling via className or style props, configure global Ant Design themes via ConfigProvider, and extend validation logic seamlessly.