About
A floating-label text input with filled and outlined variants, leading/trailing icon slots, and supporting/error text, following Google's Material 3 design spec.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Material Text Field to your project and fits it to your theme.
Code
How Material Text Field is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import TextField from "@/components/ui/text-field";
import { useState } from "react";
export default function ErrorTextFieldDemo() {
const [password, setPassword] = useState("short");
return (
<div className="flex min-h-screen w-full items-center justify-center bg-[#fef7ff] p-8">
<TextField
label="Password"
variant="outlined"
type="password"
error
supportingText="Password must be at least 8 characters"
value={password}
onChange={(event) => setPassword(event.currentTarget.value)}
/>
</div>
);
}











