hemingtsai

ZInput

Forms

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>
  );
}

More by hemingtsai

View all
  • Z Toast Host

    Z Toast Host

  • ZStat

    ZStat

  • Status Banner

    Status Banner

  • ZCheckbox

    ZCheckbox

  • Floating Action Button

    Floating Action Button

  • Button Group

    Button Group

More in Forms

View all
  • Premium Auth

    Premium Auth

    593
  • Contact Form

    Contact Form

    28
  • Form

    Form

    4
  • Login 1

    Login 1

    70
  • Book A Demo 1

    Book A Demo 1

    94
  • Contact Card

    Contact Card

    1.1K
  • HeroUI Field Error

    HeroUI Field Error

    13
  • Form [react-aria-components]

    Form [react-aria-components]

    19