hemingtsai

ZInput

Component

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 ZInputAffixDemo() {
  const [endpoint, setEndpoint] = React.useState("api.example.com");

  return (
    <div className="w-full max-w-sm">
      <ZInput
        value={endpoint}
        onChange={(v) => setEndpoint(String(v))}
        clearable
        placeholder="api.example.com"
        prefix={<span>https://</span>}
        suffix={<span>/v1</span>}
      />
    </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