A password input with show and hide, a Caps Lock warning and a forgot link.
Import it and pass your content. The props that matter most are listed next.
"use client";
import * as React from "react";
import { PasswordField } from "@/components/ui/notchset/password-field";
export function SignInPassword({ signIn }: { signIn: (password: string) => Promise<boolean> }) {
const [password, setPassword] = React.useState("");
const [error, setError] = React.useState<string | undefined>();
const [attempts, setAttempts] = React.useState(0);
const [pending, setPending] = React.useState(false);
// Only the latest attempt may report: a slow failure can't land after a later success.
const attempt = React.useRef(0);
return (
<form
onSubmit={async (e) => {
e.preventDefault();
if (pending) return;
const id = ++attempt.current;
setPending(true);
setError(undefined);
try {
const ok = await signIn(password);
if (id !== attempt.current || ok) return;
setError("That password doesn't match.");
setAttempts((a) => a + 1);
} catch {
if (id === attempt.current) setError("Couldn't reach sign-in. Try again.");
} finally {
if (id === attempt.current) setPending(false);
}
}}
>
<PasswordField
value={password}
onValueChange={(v) => {
setPassword(v);
setError(undefined);
}}
error={error}
shake={attempts}
forgotHref="/reset"
/>
<button type="submit" disabled={pending}>
{pending ? "Signing in…" : "Sign in"}
</button>
</form>
);
}value / onValueChange–
string / fnControlled.
error–
stringSignal border and help line; sets aria-invalid.
shake–
numberBump it to shake on a refused attempt.
revealable / capsLockHint–
booleanThe show/hide key and the CAPS chip (both on).
forgotHref / onForgot–
string / fnThe Forgot link.
help–
ReactNodeThe help line when there is no error.
PasswordFielddata-slot="password-field-root"
Label, field and help.
fielddata-slot="password-field"
The 40px field.
components/ui/notchset/password-field.tsx
pnpm dlx shadcn@latest add https://notchset.dev/r/password-field.jsonpnpm dlx shadcn@latest add https://notchset.dev/r/radix-nova/password-field.jsonFree, no account or key. Use the command for your project's primitives: a radix-*, new-york or default style in components.json is Radix, a base-* style is Base UI. With the @notchset registry added, @notchset/<name> picks for you.
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Give your coding assistant the Markdown guide instead of screenshots.
https://notchset.dev/api/mcp (setup)v1.0.0 · 2026-10-02
First release