diff --git a/config/schema/flag.schema.yml b/config/schema/flag.schema.yml
index 926b798..7de26bc 100644
--- a/config/schema/flag.schema.yml
+++ b/config/schema/flag.schema.yml
@@ -123,6 +123,9 @@ flag.link_type.plugin.confirm:
     unflag_confirmation:
        type: label
        label: 'Unflag confirmation'
+    modal:
+      type: boolean
+      label: 'Use modal dialog'
 
 flag.link_type.plugin.field_entry:
   type: mapping
@@ -137,3 +140,6 @@ flag.link_type.plugin.field_entry:
     unflag_confirmation:
       type: label
       label: 'Unflag confirmation'
+    modal:
+      type: boolean
+      label: 'Use modal dialog'
diff --git a/src/Plugin/ActionLink/ConfirmForm.php b/src/Plugin/ActionLink/ConfirmForm.php
index fc741f5..4ebb727 100644
--- a/src/Plugin/ActionLink/ConfirmForm.php
+++ b/src/Plugin/ActionLink/ConfirmForm.php
@@ -2,8 +2,11 @@
 
 namespace Drupal\flag\Plugin\ActionLink;
 
+use Drupal\Component\Serialization\Json;
+use Drupal\Core\Entity\EntityInterface;
 use Drupal\flag\ActionLink\ActionLinkTypeBase;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\flag\FlagInterface;
 
 /**
  * Provides the Confirm Form link type.
@@ -36,6 +39,7 @@ class ConfirmForm extends ActionLinkTypeBase {
     $options += [
       'flag_confirmation' => 'Flag this content?',
       'unflag_confirmation' => 'Unflag this content?',
+      'modal' => FALSE,
     ];
 
     return $options;
@@ -76,6 +80,13 @@ class ConfirmForm extends ActionLinkTypeBase {
       '#required' => TRUE,
     ];
 
+    $form['display']['settings']['link_options_confirm']['modal'] = [
+      '#type' => 'checkbox',
+      '#title' => $this->t('Use a modal dialog'),
+      '#description' => $this->t('The confirmation form will be displayed in a modal dialog instead of going to a separate page.'),
+      '#default_value' => $this->configuration['modal'],
+    ];
+
     return $form;
   }
 
@@ -102,6 +113,7 @@ class ConfirmForm extends ActionLinkTypeBase {
     parent::submitConfigurationForm($form, $form_state);
     $this->configuration['flag_confirmation'] = $form_state->getValue('flag_confirmation');
     $this->configuration['unflag_confirmation'] = $form_state->getValue('unflag_confirmation');
+    $this->configuration['modal'] = $form_state->getValue('modal');
   }
 
   /**
@@ -124,4 +136,20 @@ class ConfirmForm extends ActionLinkTypeBase {
     return $this->configuration['unflag_confirmation'];
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function buildLink($action, FlagInterface $flag, EntityInterface $entity) {
+    $render = parent::buildLink($action, $flag, $entity);
+    if ($this->configuration['modal']) {
+      $render['#attached']['library'][] = 'core/drupal.ajax';
+      $render['#attributes']['class'][] = 'use-ajax';
+      $render['#attributes']['data-dialog-type'] = 'modal';
+      $render['#attributes']['data-dialog-options'] = Json::encode([
+        'width' => 'auto',
+      ]);
+    }
+    return $render;
+  }
+
 }
diff --git a/src/Plugin/ActionLink/FieldEntry.php b/src/Plugin/ActionLink/FieldEntry.php
index 579b842..51164b4 100644
--- a/src/Plugin/ActionLink/FieldEntry.php
+++ b/src/Plugin/ActionLink/FieldEntry.php
@@ -2,8 +2,11 @@
 
 namespace Drupal\flag\Plugin\ActionLink;
 
+use Drupal\Component\Serialization\Json;
+use Drupal\Core\Entity\EntityInterface;
 use Drupal\flag\ActionLink\ActionLinkTypeBase;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\flag\FlagInterface;
 
 /**
  * Class FieldEntry
@@ -84,6 +87,13 @@ class FieldEntry extends ActionLinkTypeBase {
       '#required' => TRUE,
     ];
 
+    $form['display']['settings']['link_options_field']['modal'] = [
+      '#type' => 'checkbox',
+      '#title' => $this->t('Use a modal dialog'),
+      '#description' => $this->t('The form will be displayed in a modal dialog instead of going to a separate page.'),
+      '#default_value' => $this->configuration['modal'],
+    ];
+
     return $form;
   }
 
@@ -115,6 +125,7 @@ class FieldEntry extends ActionLinkTypeBase {
     $this->configuration['flag_confirmation'] = $form_state->getValue('flag_confirmation');
     $this->configuration['edit_flagging'] = $form_state->getValue('flagging_edit_title');
     $this->configuration['unflag_confirmation'] = $form_state->getValue('unflag_confirmation');
+    $this->configuration['modal'] = $form_state->getValue('modal');
   }
 
   /**
@@ -152,4 +163,21 @@ class FieldEntry extends ActionLinkTypeBase {
   public function getUnflagQuestion() {
     return $this->configuration['unflag_confirmation'];
   }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildLink($action, FlagInterface $flag, EntityInterface $entity) {
+    $render = parent::buildLink($action, $flag, $entity);
+    if ($this->configuration['modal']) {
+      $render['#attached']['library'][] = 'core/drupal.ajax';
+      $render['#attributes']['class'][] = 'use-ajax';
+      $render['#attributes']['data-dialog-type'] = 'modal';
+      $render['#attributes']['data-dialog-options'] = Json::encode([
+        'width' => 'auto',
+      ]);
+    }
+    return $render;
+  }
+
 }
