Skip to content

Commit 2c8cf3e

Browse files
committed
Improve docs
1 parent 67f7efc commit 2c8cf3e

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

docs/RadioButtonGroupInput.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,6 @@ const choices = [
9494
/>
9595
```
9696

97-
You can render some options as disabled by setting the `disabled` field in some choices:
98-
99-
```jsx
100-
const choices = [
101-
{ id: 'tech', name: 'Tech' },
102-
{ id: 'lifestyle', name: 'Lifestyle' },
103-
{ id: 'people', name: 'People', disabled: true },
104-
];
105-
<RadioButtonGroupInput source="category" choices={choices} />
106-
```
107-
10897
The choices are translated by default, so you can use translation identifiers as choices:
10998

11099
```jsx
@@ -293,6 +282,19 @@ However, in some cases, you may not want the choice to be translated. In that ca
293282

294283
Note that `translateChoice` is set to `false` when `<RadioButtonGroupInput>` is a child of `<ReferenceInput>`.
295284

285+
## Disabled `choices`
286+
287+
You can render some options as disabled by setting the `disabled` field in some choices:
288+
289+
```jsx
290+
const choices = [
291+
{ id: 'tech', name: 'Tech' },
292+
{ id: 'lifestyle', name: 'Lifestyle' },
293+
{ id: 'people', name: 'People', disabled: true },
294+
];
295+
<RadioButtonGroupInput source="category" choices={choices} />
296+
```
297+
296298
## Fetching Choices
297299

298300
You can use [`useGetList`](./useGetList.md) to fetch choices. For example, to fetch a list of countries for a user profile:

0 commit comments

Comments
 (0)