About
A single-line text input with sm/md/lg size variants, prefix/suffix slots, a clearable button, and mono/tabular numerals for IDs and ports — ported to React from hemingtsai's Zemponet Vue UI library (MIT licensed).
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds ZInput to your project and fits it to your theme.
Code
How ZInput is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import * as React from "react";
import ZInput from "@/components/ui/zinput";
export default function ZInputSizesDemo() {
const [sm, setSm] = React.useState("");
const [md, setMd] = React.useState("");
const [lg, setLg] = React.useState("");
return (
<div
className="w-full max-w-sm"
style={{ display: "flex", flexDirection: "column", gap: 8 }}
>
<ZInput
size="sm"
value={sm}
onChange={(v) => setSm(String(v))}
placeholder="表格内"
/>
<ZInput
size="md"
value={md}
onChange={(v) => setMd(String(v))}
placeholder="默认密度"
/>
<ZInput
size="lg"
value={lg}
onChange={(v) => setLg(String(v))}
placeholder="表单页"
/>
</div>
);
}














![Form [react-aria-components]](https://cdn.21st.dev/cdn-cgi/image/fit=scale-down,width=640,quality=75,format=webp/https://cdn.21st.dev/user_jolbol1/field/814/preview.png)