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: src/components/TextInput/TextInput.mdx
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -196,16 +196,28 @@ Multiple errors.
196
196
197
197
<Storyof={TextInputStories.WithDescription} />
198
198
199
+
## Customisation
200
+
201
+
You can customise the component using the `rootClass` and `rootStyle` props to apply top-level styles. You can also use the provided CSS variables to alter deep styles.
202
+
203
+
-`--j-textinput-height` | **Type:**[`height`](https://developer.mozilla.org/en-US/docs/Web/CSS/height) | **Default:**`2.5rem` | The height of the input element.
204
+
205
+
<Storyof={TextInputStories.Custom} />
206
+
199
207
## Behaviour
200
208
201
209
### Width
202
210
203
211
This component will take up the full width of the parent component by default. You can use the `rootClass` or `rootStyle` props to set a custom width.
204
212
213
+
The minimum width is 1.5× the `--j-textinput-height` variable.
214
+
205
215
## Accessibility
206
216
207
217
This component uses native HTML behaviour for `<input />` elements. This means that it will be keyboard navigable and screen reader friendly out of the box.
208
218
219
+
`aria-invalid` is added to the `<input />` element when the `status` prop is set. This will be set to `true` when `status="error"` and `false` when `status="success"`.
220
+
209
221
`aria-describedby` is added to the `<input />` element when the `description` slot is used to associate this content with the input.
210
222
211
223
`aria-errormessage` is added to the `<input />` element when the `error` slot is used to associate this content with the input.
0 commit comments