Appearance
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 / API | Type | Default | Notes |
|---|---|---|---|
type | string | "text" | type của input native |
disabled | boolean | false | Mờ + không tương tác |
aria-invalid | boolean | "true" | — | FormField gán khi có lỗi |
className | string | — | Escape hatch |
Behavior
- Chiều cao touch
- Focus ring rõ
- Ưu tiên FormField cho label/hint/error