In a writing a Views style plugin, how can I create a text input that accepts Twig? I am writing a Views style plugin, and I have a text field (input) that I want to be able to accept Contextual Filter arguments (or potentially field values). I am envisioning it working the same as the input that shows up when you click "Override title" under the "WHEN THE FILTER VALUE IS AVAILABLE OR A DEFAULT IS PROVIDED" fieldset. So, for example, you could add {{ arguments.nid }} into the text field.

This (below) is my current form element/text field that I'd want to be able to accept the arguments. I looked into the Views codebase, but was wasn't able to figure out how Views implements accepting arguments in a text field.

$form['display']['title'] = [
    '#title' =&gt; t('Chart title'),
    '#type' =&gt; 'textfield',
    '#default_value' =&gt; $options['title'],
    '#parents' =&gt; array_merge($parents, ['title']),
  ];


Any help would be greatly appreciated!
To replace argument tokens in a Views plugin you need:

$tokens = $this-&gt;view-&gt;build_info['substitutions'];
$value = $this-&gt;viewsTokenReplace($value, $tokens);


If you've based your plugin on StylePluginBase you can use StylePluginBase::tokenizeValue, which additionally replaces row tokens as well.