Using #states in a form with checkboxes I would like when a client check one of the checkboxes, a text field appeares. Example: if he clicks on 3 checkboxes, all the textfields of the 3 show off. 
My #checkboxes : 

$form['input']['livraison'] = [
      '#title' =&gt; t('Options de livraison (à la charge de l’acheteur)'),
      '#type' =&gt; 'checkboxes',
      '#description' =&gt; t(''),
      '#options' =&gt; [
        'home' =&gt; $this-&gt;t('Retrait chez moi (gratuit)'),
        'hand' =&gt; $this-&gt;t('Remise en main propre (gratuit)'),
        'myself' =&gt; $this-&gt;t('Je livre moi-même le produit'),
        'colissimo' =&gt; $this-&gt;t('Colissimo'),
        'custom' =&gt; $this-&gt;t('Livraison personnalisée'),
      ],
      '#attributes' =&gt; [
        //define static name and id so we can easier select it
        'id' =&gt; 'select-shipping',
        'name' =&gt; 'field_select_shipping',
      ],
    ];


and my textfield : 

$form['input']['adresse_home'] = [
      '#type' =&gt; 'textfield',
      '#title' =&gt; 'Adresse',
      '#required' =&gt; false,
      '#states' =&gt; [
        //show this textfield only if the radio 'other' is selected above
        'visible' =&gt; [
          ':input[name^="field_select_shipping"]' =&gt; [['checked' =&gt; 'false'], ['value' =&gt; 'home']],
          ':input[name^="field_select_shipping"]' =&gt; [['checked' =&gt; 'false'], ['value' =&gt; 'hand']],
          ':input[name^="field_select_shipping"]' =&gt; [['checked' =&gt; 'false'], ['value' =&gt; 'myself']],
          ':input[name^="field_select_shipping"]' =&gt; [['checked' =&gt; 'false'], ['value' =&gt; 'colissimo']],
          ':input[name^="field_select_shipping"]' =&gt; [['checked' =&gt; 'true'], ['value' =&gt; 'custom']],
],
      ],
    ];


**Solution : **

As berramou sent, this way is the one that works the best with checkboxes.  If you have any issues with it look if a plugin couldn't block states, that what happened to me with iCheck. 
If you need to show all the input's checked, just put the TRUE condition in your 'visible', this way you can select 2 options and get both display correctly.
To use state for checkboxes element, you should target the specific element by JQuery selector, all elements they have the name="field_select_shipping" with value attribute different so try to target the input with both attributes try with the following to show adresse_home only if home and colissimo checkbox checked:

$form['input']['adresse_home'] = [
      '#type'     =&gt; 'textfield',
      '#title'    =&gt; 'Adresse',
      '#required' =&gt; FALSE,
      '#states'   =&gt; [
        'visible' =&gt; [
         ':input[name="field_select_shipping"][value="home"]' =&gt; ['checked'   =&gt; TRUE],
         // This like AND so the input show if home and colissimo checked 
        ':input[name="field_select_shipping"][value="colissimo"]' =&gt; ['checked'   =&gt; TRUE],
        ],
      ]
    ];