Skip to content

Commit

Permalink
Docs(web-twig): Improve TextArea's documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dlouhak authored and literat committed Jun 21, 2023
1 parent d808489 commit 2972d4d
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions packages/web-twig/src/Resources/components/TextArea/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,29 @@ Without lexer:

## API

| Prop name | Type | Default | Required | Description |
| ----------------- | -------------------------------------------------------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `id` | `string` || yes | TextArea and label identification |
| `isAutoResizing` | `bool` | `false` | no | If true, TextArea adjusts its height as user types, see [plugin info](#javascript-plugin-for-auto-resizing) |
| `inputProps` | `string[]` | `[]` | no | Pass additional attributes to the textarea element |
| `isDisabled` | `bool` | `false` | no | If true, TextArea is disabled |
| `isFluid` | `bool` | `false` | no | If true, the element spans to the full width of its parent |
| `isLabelHidden` | `bool` | `false` | no | If true, label is hidden |
| `isRequired` | `bool` | `false` | no | If true, TextArea is required |
| `label` | `string` || yes | Label text |
| `maxLength` | `number` | `null` | no | Maximum number of characters |
| `message` | `string`, `string[]` | `null` | no | Validation message |
| `name` | `string` | `null` | no | TextArea name |
| `placeholder` | `string` | `null` | no | TextArea placeholder |
| `rows` | `number` | `null` | no | Number of visible rows |
| `validationState` | [Validation dictionary][dictionary-validation], `error` (deprecated) | `null` | no | Type of validation state. [**DEPRECATED**][deprecated] The value "error" in the dictionary will be replaced by the value "danger". |
| `value` | `string` | `null` | no | TextArea value |
| `helperText` | `string` | `null` | no | Custom helper text |
| Prop name | Type | Default | Required | Description |
| ------------------- | -------------------------------------------------------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `helperText` | `string` | `null` | no | Custom helper text |
| `UNSAFE_helperText` | `string` | `null` | no | Unescaped custom helper text |
| `id` | `string` || yes | TextArea and label identification |
| `inputProps` | `string[]` | `[]` | no | Pass additional attributes to the textarea element |
| `isAutoResizing` | `bool` | `false` | no | If true, TextArea adjusts its height as user types, see [plugin info](#javascript-plugin-for-auto-resizing) |
| `isDisabled` | `bool` | `false` | no | If true, TextArea is disabled |
| `isFluid` | `bool` | `false` | no | If true, the element spans to the full width of its parent |
| `isLabelHidden` | `bool` | `false` | no | If true, label is hidden |
| `isRequired` | `bool` | `false` | no | If true, TextArea is required |
| `label` | `string` || yes\* | Label text |
| `UNSAFE_label` | `string` || yes\* | Unescaped label text |
| `maxLength` | `number` | `null` | no | Maximum number of characters |
| `message` | `string`, `string[]` | `null` | no | Validation message |
| `UNSAFE_message` | `string`, `string[]` | `null` | no | Unescaped validation message |
| `name` | `string` | `null` | no | TextArea name |
| `placeholder` | `string` | `null` | no | TextArea placeholder |
| `rows` | `number` | `null` | no | Number of visible rows |
| `validationState` | [Validation dictionary][dictionary-validation], `error` (deprecated) | `null` | no | Type of validation state. [**DEPRECATED**][deprecated] The value "error" in the dictionary will be replaced by the value "danger". |
| `value` | `string` | `null` | no | TextArea value |

\*: Label is required. You can use the `label` for simple text or `UNSAFE_label` for HTML content.

On top of the API options, you can add `data-*` or `aria-*` attributes to
further extend component's descriptiveness and accessibility. Also, UNSAFE styling props are available,
Expand Down

0 comments on commit 2972d4d

Please sign in to comment.