react-toolkit
react-toolkit copied to clipboard
[Input] For checkBox and Radio needs to give a particular style for some items
Description
I need to give a different style for some input who check a particular condition.
The only way I can see to act on a particular item is through the proprety options
of the component RadioInput
/CheckboxInput
.
but in options property, there is no way (I know) to do that.
We just act on all the items at the same time via the classModifier
property of the component RadioInput
/CheckboxInput
.
Proposition
If there is no way to do it, I suggest adding support for the classModifier
attribute in property options
like this :
<CheckboxInput
id="TheId"
label="TheLabel"
name="TheName"
mode="classic"
options={[
id: "id1",
label: "Item 1",
value: "value 1",
disabled: false,
classModifier: condition && "MY_STYLE"
],
[
id: "id2,
label: "Item 2",
value: "value 2",
disabled: false,
classModifier: condition && "MY_STYLE"
]}
values={value}
onChange={onChange}
/>
@axa-fr/react-toolkit-all version : 1.2.16
React version : 16.11.0
The Teams channel "Questions UI/UX - DEV" is the place to ask ! UX Guild is always open for discussion 👍
If you want to give a different style to an input, tell us:
- why : a bit of context, explanation of your intent;
- how : which aspects do you want to modify with your classModifier;
- where : in which applications do you want to apply those classModifier;