Skip to content

Input ​

Ô nhập text chiều cao touch; viền lỗi khi aria-invalid.

ts
import { Input } from "@minap/ui";

Examples ​

Mẫu sống trong Preview; chọn View code khi cần copy.

Usage ​

tsx
import * as React from "react";
import { FormField, Input } from "@minap/ui";

export function Example() {
  const [name, setName] = React.useState("");
  return (
    <>
      <FormField id="emb-name" label="Name (controlled)" hint="Default + touch height">
        <Input placeholder="Ada" value={name} onChange={(e) => setName(e.target.value)} />
      </FormField>
      <p className="text-xs text-muted-foreground">Value: {name || "—"}</p>
      <FormField id="emb-email" label="Email (uncontrolled)" error="Required">
        <Input type="email" defaultValue="" />
      </FormField>
      <FormField id="emb-lock" label="Disabled">
        <Input disabled defaultValue="Read only" />
      </FormField>
    </>
  );
}

Props / API ​

Prop / APITypeDefaultNotes
typestring"text"type của input native
disabledbooleanfalseMờ + không tương tác
aria-invalidboolean | "true"—FormField gán khi có lỗi
classNamestring—Escape hatch

Behavior ​

  • Chiều cao touch
  • Focus ring rõ
  • Ưu tiên FormField cho label/hint/error

MINAP UI — Soft Periwinkle light, Mobile-First