Appearance
Forms & inputs
Control chính, helper FormField của MINAP, và @minap/ui/form cho RHF.
Components
- Button — Điều khiển hành động chính. color = tông trạng thái (omit → primary Soft Periwinkle); variant = solid | outline | ghost | link | secondary.
- ButtonGroup — Nhóm các hành động Button liên quan với border dùng chung.
- Input — Ô nhập text chiều cao touch; viền lỗi khi aria-invalid.
- InputGroup — Input ghép addon trước/sau.
- InputOTP — Ô nhập OTP phân đoạn.
- Textarea — Văn bản nhiều dòng, hỗ trợ border invalid.
- Label — Nhãn form truy cập được.
- Checkbox — Toggle boolean với vùng chạm lớn hơn qua hàng Label.
- RadioGroup — Nhóm chọn một.
- Select — Chọn từ danh sách — ưu tiên hơn Combobox trên Mobile-First.
- Switch — Bật/tắt tức thì (~28×48).
- Slider — Điều khiển khoảng số.
- Toggle — Nút toggle pressed/unpressed.
- ToggleGroup — Nhóm toggle (single hoặc multiple).
- Form — Helper react-hook-form — import từ @minap/ui/form.
- Field — Layout field (shadcn). Cho label/hint/error ưu tiên FormField MINAP.
- FormField — Gắn id, label, hint, error → aria-invalid / aria-describedby.
- FormMessage — Text hint/error dùng bởi FormField (cũng dùng độc lập được).
- FieldGroup — Nhóm fieldset MINAP kèm legend.
- Calendar — Date picker (react-day-picker).
- DatePicker — Ô ngày form: Calendar trong Popover (desktop) hoặc Sheet (mobile).
- TimeField — Input time native có style (type=time) cho giờ trong form.
- DateTimePicker — Gộp control date + time thành một giá trị Date.
Examples
Một vài component tiêu biểu. Xem trang component để đủ Props / Behavior.
Button
tsx
import { Button } from "@minap/ui";
export function Example() {
return <Button />;
}ButtonGroup
tsx
import { Button, ButtonGroup } from "@minap/ui";
export function Example() {
return (
<>
<ButtonGroup>
<Button variant="outline">Left</Button>
<Button variant="outline">Right</Button>
</ButtonGroup>
</>
);
}Input
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>
</>
);
}InputGroup
tsx
import { InputGroup, InputGroupAddon, InputGroupInput } from "@minap/ui";
export function Example() {
return (
<>
<InputGroup>
<InputGroupAddon>@</InputGroupAddon>
<InputGroupInput placeholder="username" />
</InputGroup>
</>
);
}