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
feat(textarea,data-grid): interactive elements and controlled height (#4291)
* feat(textarea,data-grid): add support for interactive elements and control heights
* chore(ci): typedocs, lint
* feat(docs-textarea): made a note of minRows
* fix(docs): incorrect story link
* fix(docs): usage for Textarea
---------
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: packages/paste-website/src/pages/components/textarea/index.mdx
+15-15
Original file line number
Diff line number
Diff line change
@@ -63,22 +63,22 @@ A Textarea allows for any text to be entered and can't be restricted as other [i
63
63
### Accessibility
64
64
65
65
- Include a visible label on **all** form fields.
66
-
- Each label must use the `htmlFor` prop that equals the `id` of the associated textarea.
66
+
- Each label must use the `htmlFor` prop that equals the `id` of the associated Textarea.
67
67
- Avoid placeholder text. It's not broadly supported by assistive technologies, doesn't display in older browsers, and dissapears from the field when a user enters text.
68
68
- Use 1 of 3 ways to label a form field:
69
69
- Visible label with [Label](/components/label) (preferred)
70
-
- Visible label that's associated to the textarea with `aria-labelledby`
70
+
- Visible label that's associated to the Textarea with `aria-labelledby`
71
71
- Label directly using `aria-label`
72
72
- Provide clear identification of required fields in the label or at the start of a form. If you use the required field indicator, include the form key at the start of the form.
73
73
- Use the `required` prop to programatically indicate they are required to browsers.
74
74
- Use [Help Text](/components/help-text) and an error icon to show [inline error text](/patterns/error-state) on any field that errors to make it visually clear that the field changed.
75
-
- If the textarea has associated help text or error text, include the `aria-describedby` prop on the textarea. This should match the `id` of the help or error text.
75
+
- If the Textarea has associated help text or error text, include the `aria-describedby` prop on the Textarea. This should match the `id` of the help or error text.
76
76
77
77
## Examples
78
78
79
79
### Textarea
80
80
81
-
The Textarea should include the base `Textarea`, along with supporting elements to compose a textarea field that gives the user the context they need to successfully fill it out:
81
+
The Textarea should include the base `Textarea`, along with supporting elements to compose a Textarea field that gives the user the context they need to successfully fill it out:
82
82
83
83
-[**Label**](/components/label) — Every form field should have a label. The label should indicate what should be entered into field.
84
84
-**Required field indicator** — If most of the fields on a form are optional, indicate the few that are required with text or a required indicator.
@@ -88,13 +88,13 @@ The Textarea should include the base `Textarea`, along with supporting elements
Make sure to connect the <inlineCode>Label</inlineCode> to the <inlineCode>TextArea</inlineCode>. This is done with
91
-
the <inlineCode>htmlFor</inlineCode> prop on the label, and the <inlineCode>id</inlineCode> prop on the textarea.
91
+
the <inlineCode>htmlFor</inlineCode> prop on the label, and the <inlineCode>id</inlineCode> prop on the Textarea.
92
92
Those two need to match.
93
93
</CalloutText>
94
94
<CalloutText>
95
-
If the textarea has any associated help text, the textarea should also use the{''}
95
+
If the Textarea has any associated help text, the Textarea should also use the{''}
96
96
<inlineCode>aria-describedby</inlineCode> prop that equals the <inlineCode>id</inlineCode> of the help text. This
97
-
ensures screen readers know the help text ties directly to the textarea.
97
+
ensures screen readers know the help text ties directly to the Textarea.
98
98
</CalloutText>
99
99
</Callout>
100
100
@@ -139,9 +139,9 @@ The Textarea should include the base `Textarea`, along with supporting elements
139
139
140
140
### Resizable Textarea
141
141
142
-
By default, the textarea is not resizable by the user. To change this, add the prop `resize='vertical'`.
142
+
By default, the Textarea is not resizable by the user. To change this, add the prop `resize='vertical'`.
143
143
144
-
You may also provide a `maxRows` prop to limit how much the textArea grows. By default this value is 10.
144
+
You may also provide a `maxRows` prop to limit how much the Textarea grows. By default this value is 10. You can also set a `minRows` value used to control the minimum height of the Textarea. By default this value is 3.
@@ -228,7 +228,7 @@ Labels should clearly describe the value being requested. They should be concise
228
228
229
229
To support internationalization, avoid starting a sentence with the label and using the field to finish it since sentence structures vary across languages. For example, use "Call log expiration date" or "How long should logs be stored?". Don't use "Remove logs after:".
230
230
231
-
Give users enough information in help text to prevent textarea and formatting errors. Keep it concise and scoped to information that will help with validation. For example, use help text if a password field has specific requirements that a user should know prior to filling it out.
231
+
Give users enough information in help text to prevent Textarea and formatting errors. Keep it concise and scoped to information that will help with validation. For example, use help text if a password field has specific requirements that a user should know prior to filling it out.
232
232
233
233
### Required field indicator
234
234
@@ -250,23 +250,23 @@ Use Help Text to show an inline error that to explains how to fix the error. For
250
250
251
251
### Optional compositional elements
252
252
253
-
-**Prefix/suffix** — Use a prefix or suffix to help users format their textarea and to provide more context about the value a user is entering. For example, you could prefix or suffix a field with a currency symbol, or use suffix to append a character counter. Make sure to consider internationalization when using prefixes or suffixes since formatting may differ across languages. For example, currency symbols are placed on the left in American English, while they're placed on the right in French. Don't use prefix/suffix text as a replacement for a label.
253
+
-**Prefix/suffix** — Use a prefix or suffix to help users format their Textarea and to provide more context about the value a user is entering. For example, you could prefix or suffix a field with a currency symbol, or use suffix to append a character counter. Make sure to consider internationalization when using prefixes or suffixes since formatting may differ across languages. For example, currency symbols are placed on the left in American English, while they're placed on the right in French. Don't use prefix/suffix text as a replacement for a label.
254
254
-**Icon** — Use an icon if you need to give the user additional controls for the field. For example, use an icon to clear a field on click, removing the need for users to manually delete their entered value. Place icon buttons that trigger an action on the right side of the field. If you need 2 actions on a field (e.g., popover trigger and clear field), place the icon button that affects the field value on the right, and the other icon on the left.
255
255
256
256
## When to use a Textarea
257
257
258
-
Use a textarea when users are expected to enter text that exceeds a single line, usually longer than a sentence.
258
+
Use a Textarea when users are expected to enter text that exceeds a single line, usually longer than a sentence.
259
259
260
260
<DoDont>
261
-
<Dotitle="Do"body="Use a textarea to encourage longer text entry."center>
261
+
<Dotitle="Do"body="Use a Textarea to encourage longer text entry."center>
262
262
<Boxwidth="100%"padding="space60">
263
263
<LabelhtmlFor="long_do">Tell us your life story</Label>
0 commit comments