Skip to content

Commit 1eaacc3

Browse files
authored
Merge pull request #8260 from zhujinxuan/label-placement
Allow label position config in CheckboxGroupInput
2 parents 2fef6ab + 3673b81 commit 1eaacc3

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

docs/CheckboxGroupInput.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { CheckboxGroupInput } from 'react-admin';
2929
| `optionText` | Optional | `string` | `Function` | `name` | Field name of record to display in the suggestion item or function which accepts the correct record as argument (`record => {string}`) |
3030
| `optionValue` | Optional | `string` | `id` | Field name of record containing the value to use as input value |
3131
| `row` | Optional | `boolean` | `true` | Display group of elements in a compact row. |
32+
| `labelPlacement` | Optional | `"bottom" `|`"end"`|`"start"`|`"top" ` | `"end"` | The position of the checkbox label. |
3233

3334
Refer to [MUI Checkbox documentation](https://mui.com/api/checkbox/) for more details.
3435

packages/ra-ui-materialui/src/input/CheckboxGroupInput.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ export type CheckboxGroupInputProps = Omit<CommonInputProps, 'source'> &
278278
row?: boolean;
279279
// Optional as this input can be used inside a ReferenceInput
280280
source?: string;
281+
labelPlacement?: 'bottom' | 'end' | 'start' | 'top';
281282
};
282283

283284
const PREFIX = 'RaCheckboxGroupInput';

packages/ra-ui-materialui/src/input/CheckboxGroupInputItem.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const CheckboxGroupInputItem = props => {
1616
options,
1717
translateChoice,
1818
value,
19+
labelPlacement,
1920
...rest
2021
} = props;
2122

@@ -50,6 +51,7 @@ export const CheckboxGroupInputItem = props => {
5051
/>
5152
}
5253
label={choiceName}
54+
labelPlacement={labelPlacement}
5355
/>
5456
);
5557
};

0 commit comments

Comments
 (0)