How to render the 'actions' section of a form in twig template? given a form that is built like the following:

public function buildForm(array $form, FormStateInterface $form_state)
{
   $form['#theme'] = 'mymodule_testForm';
   $form['actions']['#type'] = 'actions';
   $form['actions']['submit'] = array(
      '#type' =&gt; 'submit',
      '#value' =&gt; t('submit'),
      '#button_type' =&gt; 'primary',
   );
   return $form;
}


How do I access the submit button in my twig template?
Hat tip to Clive who already answered the question as a comment:

{{ form.actions}}


To render the rest of the form, you can do something like {{ form | without('actions') }}

So you whole code will look something like this:

In my_module.module:

/**
 * Implements hook_theme().
 */
function my_module_theme($existing, $type, $theme, $path) {
  $result = [
    'custom_form' =&gt; [
      'render element' =&gt; 'form',
      'template' =&gt; 'custom-form',
    ],
  ];

  return $result;
}


And in custom-form.html.twig:

&lt;div class="col-md-8"&gt;
    &lt;h3&gt;Form&lt;/h3&gt;
    {{ form | without('actions') }}
&lt;/div&gt;
&lt;aside class="col-md-4"&gt;
    &lt;h3&gt;Action&lt;/h3&gt;
    {{ form.actions }}
&lt;/aside&gt;


For more reading:


Similar Q&amp;A:


https://stackoverflow.com/questions/48997506/how-to-render-specific-form-elements-drupal-8
How to pass a custom Form to a Twig template

Drupal.org documentation on Twig filters in Drupal: https://www.drupal.org/docs/8/theming/twig/filters-modifying-variables-in-twig-templates


Hope that helps!