Skip to content

Commit d0355cb

Browse files
authored
Merge pull request #9069 from marmelab/doc-clearer-input-label-explanation
[Doc] clearer explanation for input label
2 parents fbf2802 + 41dbfa1 commit d0355cb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/Inputs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ All input components accept the following props:
4747
| `format` | Optional | `Function` | `value => value == null ? '' : value` | Callback taking the value from the form state, and returning the input value. |
4848
| `fullWidth` | Optional | `boolean` | `false` | If `true`, the input will expand to fill the form width |
4949
| `helperText` | Optional | `string` | - | Text to be displayed under the input (cannot be used inside a filter) |
50-
| `label` | Optional | `string` | - | Input label. In i18n apps, the label is passed to the `translate` function. Defaults to the humanized `source` when omitted. Set `label={false}` to hide the label. |
50+
| `label` | Optional | `string` | - | Input label. In i18n apps, the label is passed to the `translate` function. When omitted, the `source` property is humanized and used as a label. Set `label={false}` to hide the label. |
5151
| `parse` | Optional | `Function` | `value => value === '' ? null : value` | Callback taking the input value, and returning the value you want stored in the form state. |
5252
| `sx` | Optional | `SxProps` | - | Material UI shortcut for defining custom styles |
5353
| `validate` | Optional | `Function` | `array` | - | Validation rules for the current property. See the [Validation Documentation](./Validation.md#per-input-validation-built-in-field-validators) for details. |
@@ -205,7 +205,7 @@ Set `helperText` to `false` to remove the empty line below the input. Beware tha
205205

206206
## `label`
207207

208-
Input label. Defaults to the humanized `source` when omitted. Set `label={false}` to hide the label.
208+
The input label. In i18n apps, the label is passed to the translate function. When omitted, the `source` property is humanized and used as a label. Set `label={false}` to hide the label.
209209

210210
```jsx
211211
<TextInput source="title" /> {/* input label is "Title" */}

0 commit comments

Comments
 (0)