react-toolkit icon indicating copy to clipboard operation
react-toolkit copied to clipboard

[Input] For checkBox and Radio needs to give a particular style for some items

Open LotfiMEZIANI opened this issue 5 years ago • 1 comments

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

LotfiMEZIANI avatar Feb 04 '20 15:02 LotfiMEZIANI

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;

djaumes avatar Feb 04 '21 10:02 djaumes