Appearance
FormMessage
Text hint/error dùng bởi FormField (cũng dùng độc lập được).
ts
import { FormMessage } from "@minap/ui";1
Examples
Mẫu sống trong Preview; chọn View code khi cần copy.
Usage
tsx
import { FormMessage } from "@minap/ui";
export function Example() {
return (
<>
<FormMessage tone="hint">Hint message</FormMessage>
<FormMessage tone="error" role="alert">
Error message
</FormMessage>
</>
);
}1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Props / API
| Prop / API | Type | Default | Notes |
|---|---|---|---|
tone | "hint" | "error" | "hint" | |
id | string | — | Cho aria-describedby |
role | string | — | Dùng alert cho lỗi |
Behavior
- Khác FormMessage của @minap/ui/form (RHF)