Where can I find all form display options types for custom entity fields? I created a custom entity with drupal generate:entity:content.

I am adding fields in the baseFieldDefinitions method of the entity class.

Below is what drupal console generates by default for the name field.

Where I can find a list of all possible type values for -&gt;setDisplayOptions('form'). For example, the field below uses string_textfield.

public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    ...
    $fields['name'] = BaseFieldDefinition::create('string')
      -&gt;setLabel(t('Name'))
      -&gt;setDescription(t('The name of the entity.'))
      -&gt;setSettings([
        'max_length' =&gt; 50,
        'text_processing' =&gt; 0,
      ])
      -&gt;setDefaultValue('')
      -&gt;setDisplayOptions('view', [
        'label' =&gt; 'above',
        'type' =&gt; 'string',
        'weight' =&gt; -4,
      ])
      -&gt;setDisplayOptions('form', [
        'type' =&gt; 'string_textfield',
        'weight' =&gt; -4,
      ])
      -&gt;setDisplayConfigurable('form', TRUE)
      -&gt;setDisplayConfigurable('view', TRUE);
Those are field widget plugin IDs.

You can get all of those by querying the field widget plugin manager (service ID: plugin.manager.field.widget).

E.g. to get all the IDs in your entity class (once the service is injected):

$widget_types = $this-&gt;fieldWidgetPluginManager-&gt;getDefinitions();
$plugin_ids = array_keys($widget_types);


Same thing in procedural code in case someone wants it:

$widget_types = \Drupal::service('plugin.manager.field.widget')-&gt;getDefinitions();
$plugin_ids = array_keys($widget_types);


If your current context allows you to inject the widget plugin manager service rather than get it from \Drupal, all the better.