You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/forms.md
+38-2Lines changed: 38 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,35 @@
1
1
---
2
-
title: Form Errors
2
+
title: Forms
3
3
category: Guides
4
4
order: 4
5
5
relevantForAI: true
6
6
---
7
7
8
-
# Adding Error Messages to Form Components
8
+
## Required Fields
9
+
10
+
InstUI form components display an asterisk (`*`) next to labels when the `isRequired` (or `required`) prop is set. Whenever a form contains required fields, you **must include a note** explaining what the asterisk means — typically "Fields marked with an asterisk (\*) are required."
11
+
12
+
> **Exception:** You can omit this note when the form's purpose is entirely self-evident — for example, a standard login screen where it is obvious that both the email and password fields are required.
InstUI offers a range of form elements and all of them have a similar API to handle error/hint/success messages. These components use the `messages` prop with the following type definition:
Copy file name to clipboardExpand all lines: packages/__docs__/buildScripts/ai-accessible-documentation/summaries-for-llms-file.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -433,7 +433,7 @@
433
433
"summary": "Comprehensive focus management system for dialogs, modals, and popovers. Uses Dialog component with FocusRegion and FocusRegionManager to trap focus, handle escape keys, and manage screen reader accessibility."
434
434
},
435
435
{
436
-
"title": "form-errors",
436
+
"title": "forms",
437
437
"summary": "InstUI form components use a `messages` prop for error/hint/success messages. Required fields now show an asterisk automatically. Examples provided for various form components like TextInput, Checkbox, and DateTimeInput."
Copy file name to clipboardExpand all lines: packages/ui-checkbox/src/Checkbox/v1/README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,6 +162,20 @@ type: example
162
162
/>
163
163
```
164
164
165
+
### Required Fields
166
+
167
+
Whenever a `Checkbox` is required, you must include a note explaining what the asterisk means — typically "Fields marked with an asterisk (\*) are required."
Copy file name to clipboardExpand all lines: packages/ui-checkbox/src/Checkbox/v2/README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,6 +166,20 @@ type: example
166
166
167
167
The underlying `<input>` has a `data-checked` attribute (`"true"`, `"false"`, or `"mixed"` when indeterminate) that can be queried from the DOM to read the current state.
168
168
169
+
### Required Fields
170
+
171
+
Whenever a `Checkbox` is required, you must include a note explaining what the asterisk means — typically "Fields marked with an asterisk (\*) are required."
Copy file name to clipboardExpand all lines: packages/ui-form-field/src/FormFieldGroup/v1/README.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,6 +100,26 @@ type: example
100
100
</FormFieldGroup>
101
101
```
102
102
103
+
### Required Fields
104
+
105
+
Whenever a `FormFieldGroup` contains required fields, you must include a note explaining what the asterisk means — typically "Fields marked with an asterisk (\*) are required."
106
+
107
+
```js
108
+
---
109
+
type: example
110
+
---
111
+
<FormFieldGroup
112
+
description="Contact Information"
113
+
rowSpacing="small"
114
+
layout="stacked"
115
+
>
116
+
<Text>Fields marked with an asterisk <span aria-hidden="true">(*)</span> are required.</Text>
Copy file name to clipboardExpand all lines: packages/ui-form-field/src/FormFieldGroup/v2/README.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,6 +100,26 @@ type: example
100
100
</FormFieldGroup>
101
101
```
102
102
103
+
### Required Fields
104
+
105
+
Whenever a `FormFieldGroup` contains required fields, you must include a note explaining what the asterisk means — typically "Fields marked with an asterisk (\*) are required."
106
+
107
+
```js
108
+
---
109
+
type: example
110
+
---
111
+
<FormFieldGroup
112
+
description="Contact Information"
113
+
rowSpacing="small"
114
+
layout="stacked"
115
+
>
116
+
<Text>Fields marked with an asterisk <span aria-hidden="true">(*)</span> are required.</Text>
0 commit comments