Why do my custom elements not get rendered? I've tried to create custom Webform elements of type radios and checkboxes. The element is available in the Webform UI for admin, I can add it to my webforms from build section but it is not getting rendered in webform frontend. I have no idea what I'm missing.
(Note: I have created another custom elements of type textfield, selectbox, autocomplete and they all are working fine.)
Below is my custom src/Element code and src/Plugin/WebformElement code: (Do I need to add/modify any other files to get this elements rendered on frontend form?)
--&gt; src/Element/MyCustomRadio.php

&lt;?php

namespace Drupal\my_custom_element\Element;

use Drupal\Core\Render\Element\Radios;
use Drupal\Core\Render\Element\FormElement;
use Drupal\Core\Form\FormStateInterface;

/**
 * @FormElement(&quot;my_custom_element&quot;)
 *
 */
class MyCustomRadio extends Radios {

  /**
   * {@inheritdoc}
   */
  public function getInfo() {
    $class = get_class($this);
    return [
      '#input' =&gt; TRUE,
      '#size' =&gt; 60,
      '#process' =&gt; [
        [$class, 'processMyCustomRadio'],
        [$class, 'processAjaxForm'],
      ],
      '#element_validate' =&gt; [
        [$class, 'validateMyCustomRadio'],
      ],
      '#pre_render' =&gt; [
        [$class, 'preRenderMyCustomRadio'],
      ],
      '#theme' =&gt; 'input__my_custom_element',
      '#theme_wrappers' =&gt; ['form_element'],
    ];
  }

  public static function processMyCustomRadio(&amp;$element, FormStateInterface $form_state, &amp;$complete_form) {
    // Here you can add and manipulate your element's properties and callbacks.
    return $element;
  }

  public static function validateMyCustomRadio(&amp;$element, FormStateInterface $form_state, &amp;$complete_form) {
    // Here you can add custom validation logic.
  }

  /**
   * @param array $element
   * @return array
   */
  public static function preRenderMyCustomRadio(array $element) {
    $element['#attributes']['type'] = 'checkboxes';
    Element::setAttributes($element, ['id', 'name','value']);
    static::setAttributes($element, ['form-text', 'my-custom-element']);
    return $element;
  }

}

================================================================================================
--&gt; src/Plugin/WebformElement/MyCustomRadio.php
&lt;?php

namespace Drupal\my_custom_element\Plugin\WebformElement;

use Drupal\Core\Form\FormStateInterface;
use Drupal\webform\Plugin\WebformElement\Radios;
use Drupal\webform\Plugin\WebformElementBase;
use Drupal\webform\WebformSubmissionInterface;

/**
 * Provides a 'my_custom_element' element.
 *
 * @WebformElement(
 *   id = &quot;my_custom_radio_element&quot;,
 *   label = @Translation(&quot;My Custom Radio&quot;),
 *   description = @Translation(&quot;Provides a webform radio element.&quot;),
 *   category = @Translation(&quot;My Custom elements&quot;),
 * )
 */
class MyCustomRadio extends Radios {

  /**
   * {@inheritdoc}
   */
  protected function defineDefaultProperties() {

    return [
      'multiple' =&gt; '',
      'size' =&gt; '',
      'minlength' =&gt; '',
      'maxlength' =&gt; '',
      'placeholder' =&gt; '',
    ] + parent::defineDefaultProperties();
  }

  /**
   * {@inheritdoc}
   */
  public function prepare(array &amp;$element, WebformSubmissionInterface $webform_submission = NULL) {
    parent::prepare($element, $webform_submission);
    
  }

  /**
   * {@inheritdoc}
   */
  public function form(array $form, FormStateInterface $form_state) {
    $form = parent::form($form, $form_state);
    return $form;
  }

}

================================================================================================
I have also attached image so that it can help oneself to understand the problem clearly. This module is made in fresh drupal 8 instance. Please let me know if any specific detail is required.
In admin panel: (i have option to add custom radios in my form)

In frontend: (Custom Radios is not rendered, only drupal&amp;contrib radios and checkboxes is rendered)
For radios or checkboxes to work you need to call
\Drupal\Core\Render\Element\Checkboxes::processCheckboxes

or
\Drupal\Core\Render\Element\Radios::processRadios

Your example code, is extending Radios but trying to render checkboxes. I recommend extending Checkboxes and gradually override the default methods including \Drupal\Core\Render\Element\Checkboxes::processCheckboxes.
Below is an example
&lt;?php

namespace Drupal\my_custom_element\Element;

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element\Checkboxes;

/**
 * Provides a form element for a set of My custom element.
 *
 * @FormElement(&quot;my_custom_element&quot;)
 */
class MyCustomElement extends Checkboxes {

  /**
   * {@inheritdoc}
   */
  public function getInfo() {
    $properties = parent::getInfo();
    // My custom properties.
    $class = get_class($this);
    $properties['#process'][] = [$class, 'processMyCustomElement'];
    $properties['#element_validate'] = [[$class, 'validateMyCustomRadio']];
    return $properties;
  }

  /**
   * {@inheritdoc}
   */
  public static function processCheckboxes(&amp;$element, FormStateInterface $form_state, &amp;$complete_form) {
    // You can override and extend this method.
    $element = parent::processCheckboxes($element, $form_state, $complete_form)
    return $element;
  }

  public static function processMyCustomRadio(&amp;$element, FormStateInterface $form_state, &amp;$complete_form) {
    // Here you can add and manipulate your element's properties and callbacks.
    return $element;
  }

  public static function validateMyCustomRadio(&amp;$element, FormStateInterface $form_state, &amp;$complete_form) {
    // Here you can add custom validation logic.
  }
}