You can make use of template partials when generating your element HTML.
Tailor's template partial function works in a similar way to the WordPress'
get_template_part() function in that you specify the general type of template, followed by a more specific subtype.
In the above example, the function will look for
content-custom.php and, if that cannot be found,
The partials directory of child themes will be searched first, then the active theme and finally the partials directory of the plugin itself.
If you are creating an extension plugin and would like to add your own partials in a partials directory in your plugin, you can filter the list of locations that will be searched using the
tailor_plugin_partial_path filter as follows:
You can see an example of this in the Tailor Portfolio extension.